diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-08-16 14:26:22 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-08-16 14:26:22 -0700 |
commit | c45116a064218d40103c3ec6435f55b5aac6200a (patch) | |
tree | 9c92cbb776a692c7675cd28dc522688dbb405eb4 | |
parent | 1d89260748bcf2ba5965ffa67126f3edaef31f07 (diff) | |
parent | b02f43677abef35d8fe57a7a575fc143d9523742 (diff) |
Merge pull request #1532 from juj/fix_test_runner_returncode
Fix test runner returncode.
-rwxr-xr-x | tests/runner.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/runner.py b/tests/runner.py index 8feb83f9..bdbd2676 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -766,11 +766,17 @@ an individual test with except: pass + numFailures = 0 # Keep count of the total number of failing tests. + # Run the discovered tests if not len(suites): print >> sys.stderr, 'No tests found for %s' % str(sys.argv[1:]) + numFailures = 1 else: testRunner = unittest.TextTestRunner(verbosity=2) for suite in suites: - testRunner.run(suite) + results = testRunner.run(suite) + numFailures += len(results.errors) + len(results.failures) + # Return the number of failures as the process exit code for automating success/failure reporting. + exit(numFailures) |