From 3506d8daf2e67ad44d71f04943a427a42e96031f Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 9 Feb 2021 18:31:56 +0100 Subject: mtest: TestSetup can have [] as an exe_wrapper Fix "meson test --wrapper foo --setup bar", it should work just fine if the setup does not define a wrapper. Signed-off-by: Paolo Bonzini --- mesonbuild/mtest.py | 4 ++-- run_unittests.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py index 1d7c6cc98..f60f5b032 100644 --- a/mesonbuild/mtest.py +++ b/mesonbuild/mtest.py @@ -1490,10 +1490,10 @@ class TestHarness: options.timeout_multiplier = current.timeout_multiplier # if options.env is None: # options.env = current.env # FIXME, should probably merge options here. - if options.wrapper is not None and current.exe_wrapper is not None: - sys.exit('Conflict: both test setup and command line specify an exe wrapper.') if options.wrapper is None: options.wrapper = current.exe_wrapper + elif current.exe_wrapper: + sys.exit('Conflict: both test setup and command line specify an exe wrapper.') return current.env.get_env(os.environ.copy()) def get_test_runner(self, test: TestSerialisation) -> SingleTestRunner: diff --git a/run_unittests.py b/run_unittests.py index 839f82bf9..80833425f 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -2551,6 +2551,8 @@ class AllPlatformTests(BasePlatformTests): self._run(self.mtest_command + ['--setup=onlyenv3']) # Setup with only a timeout works self._run(self.mtest_command + ['--setup=timeout']) + # Setup that does not define a wrapper works with --wrapper + self._run(self.mtest_command + ['--setup=timeout', '--wrapper', shutil.which('valgrind')]) # Setup that skips test works self._run(self.mtest_command + ['--setup=good']) with open(os.path.join(self.logdir, 'testlog-good.txt')) as f: -- cgit v1.2.3