| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,6 +29,7 @@ | |||
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | 31 | from __future__ import print_function | |
| 32 | + from typing import Dict | ||
| 32 | 33 | import logging | |
| 33 | 34 | import optparse | |
| 34 | 35 | import os | |
@@ -147,7 +148,7 @@ def PrintFailureHeader(self, test): | |||
| 147 | 148 | }) | |
| 148 | 149 | print("Path: %s" % "/".join(test.path)) | |
| 149 | 150 | ||
| 150 | - def Run(self, tasks): | ||
| 151 | + def Run(self, tasks) -> Dict: | ||
| 151 | 152 | self.Starting() | |
| 152 | 153 | threads = [] | |
| 153 | 154 | # Spawn N-1 threads and then use this thread as the last one. | |
@@ -172,7 +173,10 @@ def Run(self, tasks): | |||
| 172 | 173 | # ...and then reraise the exception to bail out | |
| 173 | 174 | raise | |
| 174 | 175 | self.Done() | |
| 175 | - return not self.failed | ||
| 176 | + return { | ||
| 177 | + 'allPassed': not self.failed, | ||
| 178 | + 'failed': self.failed, | ||
| 179 | + } | ||
| 176 | 180 | ||
| 177 | 181 | def RunSingle(self, parallel, thread_id): | |
| 178 | 182 | while not self.shutdown_event.is_set(): | |
@@ -479,6 +483,7 @@ def HasRun(self, output): | |||
| 479 | 483 | print("--- %s ---" % PrintCrashed(output.output.exit_code)) | |
| 480 | 484 | if output.HasTimedOut(): | |
| 481 | 485 | print("--- TIMEOUT ---") | |
| 486 | + print("\n") # Two blank lines between failures, for visual separation | ||
| 482 | 487 | ||
| 483 | 488 | def Truncate(self, str, length): | |
| 484 | 489 | if length and (len(str) > (length - 3)): | |
@@ -1757,10 +1762,8 @@ def should_keep(case): | |||
| 1757 | 1762 | else: | |
| 1758 | 1763 | try: | |
| 1759 | 1764 | start = time.time() | |
| 1760 | - if RunTestCases(cases_to_run, options.progress, options.j, options.flaky_tests, options.measure_flakiness): | ||
| 1761 | - result = 0 | ||
| 1762 | - else: | ||
| 1763 | - result = 1 | ||
| 1765 | + result = RunTestCases(cases_to_run, options.progress, options.j, options.flaky_tests, options.measure_flakiness) | ||
| 1766 | + exitcode = 0 if result['allPassed'] else 1 | ||
| 1764 | 1767 | duration = time.time() - start | |
| 1765 | 1768 | except KeyboardInterrupt: | |
| 1766 | 1769 | print("Interrupted") | |
@@ -1777,7 +1780,14 @@ def should_keep(case): | |||
| 1777 | 1780 | t = FormatTimedelta(entry.duration) | |
| 1778 | 1781 | sys.stderr.write("%4i (%s) %s\n" % (i, t, entry.GetLabel())) | |
| 1779 | 1782 | ||
| 1780 | - return result | ||
| 1783 | + if result['allPassed']: | ||
| 1784 | + print("\nAll tests passed.") | ||
| 1785 | + else: | ||
| 1786 | + print("\nFailed tests:") | ||
| 1787 | + for failure in result['failed']: | ||
| 1788 | + print(EscapeCommand(failure.command)) | ||
| 1789 | + | ||
| 1790 | + return exitcode | ||
| 1781 | 1791 | ||
| 1782 | 1792 | ||
| 1783 | 1793 | if __name__ == '__main__': | |
| Back | FazBrowse Home | New Git URL |
0 commit comments