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: 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 7fff3771e9..3b3b61f115 100644 --- a/lib/spack/spack/build_systems/cmake.py +++ b/lib/spack/spack/build_systems/cmake.py @@ -248,7 +248,8 @@ class CMakeBuilder(BaseBuilder): @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 54ed485f25..79cea99eeb 100644 --- a/lib/spack/spack/test/build_systems.py +++ b/lib/spack/spack/test/build_systems.py @@ -23,8 +23,6 @@ from spack.util.executable import which 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 test_dir(tmpdir): 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 @@ class TestTargets: 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): -- cgit v1.2.3-70-g09d2