From f3c080e54667115cf8b531184912a5bce49f802b Mon Sep 17 00:00:00 2001 From: markus-ferrell <116021216+markus-ferrell@users.noreply.github.com> Date: Thu, 10 Aug 2023 13:16:23 -0400 Subject: [PATCH] Windows build systems: use ninja and enable tests (#33589) * Set default CMake generator is ninja on Windows * Enable build systems tests (except for autotools/make) --- lib/spack/spack/build_systems/cmake.py | 3 ++- lib/spack/spack/test/build_systems.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/spack/spack/build_systems/cmake.py b/lib/spack/spack/build_systems/cmake.py index 7fff3771e9b..3b3b61f1153 100644 --- a/lib/spack/spack/build_systems/cmake.py +++ b/lib/spack/spack/build_systems/cmake.py @@ -248,7 +248,8 @@ def std_cmake_args(self): @staticmethod def std_args(pkg, generator=None): """Computes the standard cmake arguments for a generic package""" - generator = generator or "Unix Makefiles" + default_generator = "Ninja" if sys.platform == "win32" else "Unix Makefiles" + generator = generator or default_generator valid_primary_generators = ["Unix Makefiles", "Ninja"] primary_generator = _extract_primary_generator(generator) if primary_generator not in valid_primary_generators: diff --git a/lib/spack/spack/test/build_systems.py b/lib/spack/spack/test/build_systems.py index 54ed485f250..79cea99eeba 100644 --- a/lib/spack/spack/test/build_systems.py +++ b/lib/spack/spack/test/build_systems.py @@ -23,8 +23,6 @@ DATA_PATH = os.path.join(spack.paths.test_path, "data") -pytestmark = pytest.mark.skipif(sys.platform == "win32", reason="does not run on windows") - @pytest.fixture() def concretize_and_setup(default_mock_concretization): @@ -45,6 +43,7 @@ def _func(dir_str): return _func +@pytest.mark.skipif(sys.platform == "win32", reason="make not available on Windows") @pytest.mark.usefixtures("config", "mock_packages", "working_env") class TestTargets: @pytest.mark.parametrize( @@ -93,6 +92,7 @@ def test_negative_ninja_check(self, input_dir, test_dir, concretize_and_setup): s.package._if_ninja_target_execute("check") +@pytest.mark.skipif(sys.platform == "win32", reason="autotools not available on windows") @pytest.mark.usefixtures("config", "mock_packages") class TestAutotoolsPackage: def test_with_or_without(self, default_mock_concretization):