From c7c2bc8db111a5be277aeb14aecfe0d28ab286a9 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 2 Feb 2021 09:27:16 +0100 Subject: interpreter, mtest: introduce add_test_setup(exclude_suites: ...) This new keyword argument makes it possible to run specific test setups only on a subset of the tests. For example, to mark some tests as slow and avoid running them by default: add_test_setup('quick', exclude_suites: ['slow'], is_default: true) add_test_setup('slow') It will then be possible to run the slow tests with either `meson test --setup slow` or `meson test --suite slow`. --- run_unittests.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'run_unittests.py') diff --git a/run_unittests.py b/run_unittests.py index 2a14f78..ebe8f48 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -2351,6 +2351,16 @@ 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 skips test works + self._run(self.mtest_command + ['--setup=good']) + with open(os.path.join(self.logdir, 'testlog-good.txt')) as f: + exclude_suites_log = f.read() + self.assertFalse('buggy' in exclude_suites_log) + # --suite overrides add_test_setup(xclude_suites) + self._run(self.mtest_command + ['--setup=good', '--suite', 'buggy']) + with open(os.path.join(self.logdir, 'testlog-good.txt')) as f: + include_suites_log = f.read() + self.assertTrue('buggy' in include_suites_log) def test_testsetup_selection(self): testdir = os.path.join(self.unit_test_dir, '14 testsetup selection') -- cgit v1.1