diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-11-11 10:38:16 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-11-11 10:38:16 -0800 |
commit | 87acef9548f70a42c5a79a1037b3cc36aeb3a08c (patch) | |
tree | 1194d8f322811d0a47d28c393a3af3fd9e765327 | |
parent | 72e1ce8b4bfa082a72f154e4ca4a2f6ba504db5b (diff) |
allow skipping tests in test runner with skip:SUITE.TEST
-rwxr-xr-x | tests/runner.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index b67d068e..3014fe9a 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -78,6 +78,9 @@ class RunnerCore(unittest.TestCase): stderr_redirect = STDOUT # This avoids cluttering the test runner output, which is stderr too, with compiler warnings etc. # Change this to None to get stderr reporting, for debugging purposes + def skipme(self): # used by tests we ask on the commandline to be skipped, see right before call to unittest.main + return self.skip('requested to be skipped') + def setUp(self): global Settings Settings.reset() @@ -10187,6 +10190,17 @@ if __name__ == '__main__': elif len(JS_ENGINES) < total_engines: print 'WARNING: Not all the JS engines in JS_ENGINES appears to work, ignoring those.' + # Skip requested tests + + for i in range(len(sys.argv)): + arg = sys.argv[i] + if arg.startswith('skip:'): + which = arg.split('skip:')[1] + print >> sys.stderr, 'will skip "%s"' % which + exec(which + ' = RunnerCore.skipme') + sys.argv[i] = '' + sys.argv = filter(lambda arg: arg, sys.argv) + # Go unittest.main() |