From 6299f181295b720391750d493456cd8d7bc3a0fd Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sun, 17 Nov 2024 00:57:19 -0500 Subject: ninja backend: don't rebuild all tests by default When running `ninja all` we shouldn't build testsuite programs as these might not be wanted e.g. in order to just install the project. We do want them to be built when running `ninja test`. Since meson 0.63 we actually have a dedicated ninja alias for test dependencies -- move these from the "all" rule to the dedicated test/benchmark rules. Closes: https://github.com/mesonbuild/meson/issues/1704 Closes: https://github.com/mesonbuild/meson/issues/1949 Closes: https://github.com/mesonbuild/meson/issues/2518 Closes: https://github.com/mesonbuild/meson/issues/3662 Closes: https://github.com/mesonbuild/meson/pull/5728 Closes: https://github.com/mesonbuild/meson/pull/5867 Closes: https://github.com/mesonbuild/meson/pull/6511 Closes: https://github.com/mesonbuild/meson/pull/11317 Closes: https://github.com/mesonbuild/meson/issues/13378 --- run_project_tests.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'run_project_tests.py') diff --git a/run_project_tests.py b/run_project_tests.py index ab34c27f2..0dc287191 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -712,7 +712,14 @@ def _run_test(test: TestDef, # Build with subprocess def build_step() -> None: build_start = time.time() - pc, o, _ = Popen_safe(compile_commands + dir_args, cwd=test_build_dir, stderr=subprocess.STDOUT) + + if backend is Backend.ninja: + # FIXME: meson test inprocess does not handle running ninja via StringIO + targets = ['all', 'meson-test-prereq', 'meson-benchmark-prereq'] + else: + targets = [] + + pc, o, _ = Popen_safe(compile_commands + dir_args + targets, cwd=test_build_dir, stderr=subprocess.STDOUT) testresult.add_step(BuildStep.build, o, '', '', time.time() - build_start) if should_fail == 'build': if pc.returncode != 0: -- cgit v1.2.3