aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2013-08-16 19:10:01 +0300
committerJukka Jylänki <jujjyl@gmail.com>2013-08-16 19:10:01 +0300
commitb02f43677abef35d8fe57a7a575fc143d9523742 (patch)
tree511a6be38ad60546fbc808ebeda04ef78320abb3
parenta7b1ef9be07f040c751ea1f65aaf4e02989f4f89 (diff)
Fix test runner process exit code to report the number of failing tests, like it did before.
-rwxr-xr-xtests/runner.py8
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)