aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-02-27 21:40:32 +0200
committerGitHub <noreply@github.com>2018-02-27 21:40:32 +0200
commit59e7ea169f3d875b2dfefc0d7a41a2ea9eca08f0 (patch)
tree2bc543667d64e910b34be00fe7847fb6dbb3e8ab /run_unittests.py
parent16f80b4c506bba9839e30bd98fcbbafddcef3632 (diff)
parent4f8db1fe47056fa650236c9c89ddd4814a271174 (diff)
downloadmeson-59e7ea169f3d875b2dfefc0d7a41a2ea9eca08f0.zip
meson-59e7ea169f3d875b2dfefc0d7a41a2ea9eca08f0.tar.gz
meson-59e7ea169f3d875b2dfefc0d7a41a2ea9eca08f0.tar.bz2
Merge pull request #2311 from trhd/setups
Improve test setup selection.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 41cbf39..b69aaae 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -949,6 +949,31 @@ class AllPlatformTests(BasePlatformTests):
# Setup with only a timeout works
self._run(self.mtest_command + ['--setup=timeout'])
+ def test_testsetup_selection(self):
+ testdir = os.path.join(self.unit_test_dir, '13 testsetup selection')
+ self.init(testdir)
+ self.build()
+
+ # Run tests without setup
+ self.run_tests()
+
+ self.assertRaises(subprocess.CalledProcessError, self._run, self.mtest_command + ['--setup=missingfromfoo'])
+ self._run(self.mtest_command + ['--setup=missingfromfoo', '--no-suite=foo:'])
+
+ self._run(self.mtest_command + ['--setup=worksforall'])
+ self._run(self.mtest_command + ['--setup=main:worksforall'])
+
+ self.assertRaises(subprocess.CalledProcessError, self._run,
+ self.mtest_command + ['--setup=onlyinbar'])
+ self.assertRaises(subprocess.CalledProcessError, self._run,
+ self.mtest_command + ['--setup=onlyinbar', '--no-suite=main:'])
+ self._run(self.mtest_command + ['--setup=onlyinbar', '--no-suite=main:', '--no-suite=foo:'])
+ self._run(self.mtest_command + ['--setup=bar:onlyinbar'])
+ self.assertRaises(subprocess.CalledProcessError, self._run,
+ self.mtest_command + ['--setup=foo:onlyinbar'])
+ self.assertRaises(subprocess.CalledProcessError, self._run,
+ self.mtest_command + ['--setup=main:onlyinbar'])
+
def assertFailedTestCount(self, failure_count, command):
try:
self._run(command)