diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2021-02-02 09:27:16 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-02-02 11:23:33 +0100 |
commit | c7c2bc8db111a5be277aeb14aecfe0d28ab286a9 (patch) | |
tree | 127faceadf8c8299c65e0c8fd41b5991e5a76cee /run_unittests.py | |
parent | e7b587c81fdea066d258517e9c4862e57cb22e02 (diff) | |
download | meson-c7c2bc8db111a5be277aeb14aecfe0d28ab286a9.zip meson-c7c2bc8db111a5be277aeb14aecfe0d28ab286a9.tar.gz meson-c7c2bc8db111a5be277aeb14aecfe0d28ab286a9.tar.bz2 |
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`.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 10 |
1 files changed, 10 insertions, 0 deletions
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') |