summaryrefslogtreecommitdiff
path: root/run_project_tests.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz93@gmail.com>2024-11-17 00:57:19 -0500
committerEli Schwartz <eschwartz93@gmail.com>2025-01-07 20:16:06 -0500
commit6299f181295b720391750d493456cd8d7bc3a0fd (patch)
tree4964321f0cae39f6d296e0adf29ef163e90e8561 /run_project_tests.py
parent547dfac5fcb29c1f9076cbec34dbda5472ef572e (diff)
downloadmeson-6299f181295b720391750d493456cd8d7bc3a0fd.tar.gz
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
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-xrun_project_tests.py9
1 files changed, 8 insertions, 1 deletions
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: