# HG changeset patch # User Gregory Szorc # Date 1401243022 25200 # Node ID b3213b9fafed0a7363945248ca10a4e55a244fe8 # Parent f221eb0531d9e90a305ea425674fd146d337294c run-tests: exit with non-0 exit code when tests fail or warn As part of the run-tests.py refactor, run-tests.py accidentally started exiting with 0 for most test runs. This patch restores the expected behavior. diff -r f221eb0531d9 -r b3213b9fafed tests/run-tests.py --- a/tests/run-tests.py Fri May 23 20:23:54 2014 -0700 +++ b/tests/run-tests.py Tue May 27 19:10:22 2014 -0700 @@ -1318,6 +1318,8 @@ if self._runner.options.time: self.printtimes(result.times) + return result + def printtimes(self, times): self.stream.writeln('# Producing time report') times.sort(key=lambda t: (t[1], t[0]), reverse=True) @@ -1537,7 +1539,12 @@ if self.options.verbose: verbosity = 2 runner = TextTestRunner(self, verbosity=verbosity) - runner.run(suite) + result = runner.run(suite) + + if result.failures: + failed = True + if result.warned: + warned = True if self.options.anycoverage: self._outputcoverage()