From fccada67035e984b1af668ef7064828b34eb6442 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sun, 19 Mar 2023 18:06:43 -0400 Subject: [PATCH] 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. --- mesonbuild/mtest.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py index 0b2345e19..e1c6a21b7 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: