aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2023-03-19 18:06:43 -0400
committerEli Schwartz <eschwartz@archlinux.org>2023-03-20 16:58:15 -0400
commitfccada67035e984b1af668ef7064828b34eb6442 (patch)
treece612ff3355c19dc47e2c39ace77af6961f37305
parentb4c347674b919da8a09545ee9556bf0912e6641f (diff)
downloadmeson-fccada67035e984b1af668ef7064828b34eb6442.zip
meson-fccada67035e984b1af668ef7064828b34eb6442.tar.gz
meson-fccada67035e984b1af668ef7064828b34eb6442.tar.bz2
mtest: move the detection of rebuild compatibility out into the entry point
What we are mainly doing here is checking that the options make sense, or fixing that up if they don't. And in the next commit we will want to do that by also checking the build object.
-rw-r--r--mesonbuild/mtest.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py
index 0b2345e..e1c6a21 100644
--- a/mesonbuild/mtest.py
+++ b/mesonbuild/mtest.py
@@ -1582,12 +1582,6 @@ class TestHarness:
if self.options.no_rebuild:
return
- if not (Path(self.options.wd) / 'build.ninja').is_file():
- print('Only ninja backend is supported to rebuild tests before running them.')
- # Disable, no point in trying to build anything later
- self.options.no_rebuild = True
- return
-
self.ninja = environment.detect_ninja()
if not self.ninja:
print("Can't find ninja, can't rebuild test.")
@@ -2104,6 +2098,12 @@ def run(options: argparse.Namespace) -> int:
b = build.load(options.wd)
setup_vsenv(b.need_vsenv)
+ if not options.no_rebuild:
+ if not (Path(options.wd) / 'build.ninja').is_file():
+ print('Only ninja backend is supported to rebuild tests before running them.')
+ # Disable, no point in trying to build anything later
+ options.no_rebuild = True
+
with TestHarness(options) as th:
try:
if options.list: