Skip to content
Snippets Groups Projects
Commit f111b897 authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

test-run.py: return a non-zero exit status on failue

Return a non-zero exit status if there are test
failures, even if run with --force. This necessary to
correctly identify a test failure in buildbot run.
parent 61b4da22
No related branches found
No related tags found
No related merge requests found
......@@ -296,4 +296,9 @@ class TestSuite:
if self.args.valgrind and check_valgrind_log(self.ini["valgrind_log"]):
print " Error! There were warnings/errors in valgrind log file:"
print_tail_n(self.ini["valgrind_log"], 20)
return 1
return len(failed_tests)
......@@ -147,6 +147,7 @@ def main():
# Change the current working directory to where all test
# collections are supposed to reside.
os.chdir(os.path.dirname(sys.argv[0]))
failed_tests = 0
try:
print "Started", " ".join(sys.argv)
......@@ -155,14 +156,14 @@ def main():
suites.append(TestSuite(suite_name, options.args))
for suite in suites:
suite.run_all()
failed_tests = suite.run_all()
except RuntimeError as e:
print "\nFatal error: {0}. Execution aborted.".format(e)
return (-1)
finally:
os.chdir(oldcwd)
return 0
return -failed_tests
if __name__ == "__main__":
exit(main())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment