Tests: The run_all script was not correctly using exit code 0 when all tests pass

This commit is contained in:
Paul Beckingham 2016-02-06 12:30:19 -05:00
parent 6cbdf874be
commit 6e8050bd3d
2 changed files with 5 additions and 7 deletions

View file

@ -129,5 +129,4 @@ if __name__ == "__main__":
print_category(expected)
# If we encoutered any failures, return non-zero code
if sum(errors.values()):
sys.exit(1)
sys.exit(1 if int(error_int) or int(unexpected_int) else 0)

View file

@ -175,6 +175,8 @@ class TestRunner(object):
def show_report(self):
self.tap.flush()
sys.stdout.flush()
sys.stderr.flush()
log.debug("Calling 'problems --summary' for report")
return call([os.path.abspath("problems"), "--summary", cmd_args.tapfile])
@ -198,11 +200,8 @@ def main():
runner = TestRunner()
runner.start()
# If we're producing summary report, propagate the return code
if not cmd_args.verbose:
return runner.show_report()
else:
return 0
# Propagate the return code
return runner.show_report()
if __name__ == "__main__":