Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: mojo/tools/mojob.py

Issue 913123004: Make mojob.py test print a summary at the end. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/tools/mojob.py
diff --git a/mojo/tools/mojob.py b/mojo/tools/mojob.py
index 6e01c76fa3b487a520e287c78553f2247f44fc0e..68db6fe78cefde599e127a480c4dec49f99b0065 100755
--- a/mojo/tools/mojob.py
+++ b/mojo/tools/mojob.py
@@ -122,6 +122,7 @@ def _run_tests(config, test_types):
test_list = GetTestList(config)
dry_run = config.values.get('dry_run')
final_exit_code = 0
+ failure_list = []
for entry in test_list:
print 'Running: %s' % entry['name']
print 'Command: %s' % entry['command']
@@ -129,8 +130,22 @@ def _run_tests(config, test_types):
continue
exit_code = subprocess.call(entry['command'])
- if not final_exit_code:
- final_exit_code = exit_code
+ if exit_code:
+ if not final_exit_code:
+ final_exit_code = exit_code
+ failure_list.append(entry['name'])
+
+ print 72 * '='
+ print 'SUMMARY:',
+ if dry_run:
+ print 'Dry run: no tests run'
+ elif not failure_list:
+ assert not final_exit_code
+ print 'All tests passed'
+ else:
+ assert final_exit_code
+ print 'The following had failures:', ', '.join(failure_list)
+
return final_exit_code
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698