Mercurial > hg-stable
changeset 21613:b3213b9fafed
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.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 27 May 2014 19:10:22 -0700 |
parents | f221eb0531d9 |
children | 609a642dff61 |
files | tests/run-tests.py |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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()