diff options
author | Todd Fiala <todd.fiala@gmail.com> | 2015-12-09 19:05:44 +0000 |
---|---|---|
committer | Todd Fiala <todd.fiala@gmail.com> | 2015-12-09 19:05:44 +0000 |
commit | 0a7c32b38e36e16ee7c406cb26e9f13df1eb1a1a (patch) | |
tree | bac4fe427108719159fe3f6fd02d0e100cc46afd /lldb/packages/Python | |
parent | b67e6b6044fa9fda5bd221dbc93b20536bf20d29 (diff) | |
download | bcm5719-llvm-0a7c32b38e36e16ee7c406cb26e9f13df1eb1a1a.tar.gz bcm5719-llvm-0a7c32b38e36e16ee7c406cb26e9f13df1eb1a1a.zip |
Fix new summary to include exceptional exit count in determining exit value
The main dotest.py should exit with a system return code of 1 on any
issue. This change fixes a place where I omitted counting the
exceptional exit value to determine if we should return 1 when using the
new summary results.
This change also puts a banner around the Issue Details section that comes
before the Test Result Summary.
llvm-svn: 255138
Diffstat (limited to 'lldb/packages/Python')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/basic_results_formatter.py | 45 | ||||
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/dosep.py | 4 |
2 files changed, 35 insertions, 14 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/basic_results_formatter.py b/lldb/packages/Python/lldbsuite/test/basic_results_formatter.py index 9c3dd4749b0..46de04bbd9c 100644 --- a/lldb/packages/Python/lldbsuite/test/basic_results_formatter.py +++ b/lldb/packages/Python/lldbsuite/test/basic_results_formatter.py @@ -113,6 +113,15 @@ class BasicResultsFormatter(result_formatter.ResultsFormatter): @classmethod def _event_sort_key(cls, event): + """Returns the sort key to be used for a test event. + + This method papers over the differences in a test method result vs. a + job (i.e. inferior process) result. + + @param event a test result or job result event. + @return a key useful for sorting events by name (test name preferably, + then by test filename). + """ if "test_name" in event: return event["test_name"] else: @@ -142,8 +151,23 @@ class BasicResultsFormatter(result_formatter.ResultsFormatter): key=lambda x: self._event_sort_key(x[1])) return partitioned_events + def _print_banner(self, banner_text): + """Prints an ASCII banner around given text. + + Output goes to the out file for the results formatter. + + @param banner_text the text to display, with a banner + of '=' around the line above and line below. + """ + banner_separator = "".ljust(len(banner_text), "=") + + self.out_file.write("\n{}\n{}\n{}\n".format( + banner_separator, + banner_text, + banner_separator)) + def _print_summary_counts( - self, categories, result_events_by_status, extra_rows): + self, categories, result_events_by_status, extra_rows): """Prints summary counts for all categories. @param categories the list of categories on which to partition. @@ -167,13 +191,7 @@ class BasicResultsFormatter(result_formatter.ResultsFormatter): if name_length > max_category_name_length: max_category_name_length = name_length - banner_text = "Test Result Summary" - banner_separator = "".ljust(len(banner_text), "=") - - self.out_file.write("\n{}\n{}\n{}\n".format( - banner_separator, - banner_text, - banner_separator)) + self._print_banner("Test Result Summary") # Prepend extra rows if extra_rows is not None: @@ -248,10 +266,11 @@ class BasicResultsFormatter(result_formatter.ResultsFormatter): if event["event"] == EventBuilder.TYPE_JOB_RESULT: # Jobs status that couldn't be mapped to a test method # doesn't have as much detail. - self.out_file.write("{}: {}{} (no test method running)\n".format( - detail_label, - extra_info, - event["test_filename"])) + self.out_file.write( + "{}: {}{} (no test method running)\n".format( + detail_label, + extra_info, + event["test_filename"])) else: # Test-method events have richer detail, use that here. test_relative_path = os.path.relpath( @@ -298,7 +317,7 @@ class BasicResultsFormatter(result_formatter.ResultsFormatter): have_details = self._has_printable_details( categories, result_events_by_status) if have_details: - self.out_file.write("\nDetails:\n") + self._print_banner("Issue Details") for category in categories: self._report_category_details( category, result_events_by_status) diff --git a/lldb/packages/Python/lldbsuite/test/dosep.py b/lldb/packages/Python/lldbsuite/test/dosep.py index 0861b709732..f346d7ebfc9 100644 --- a/lldb/packages/Python/lldbsuite/test/dosep.py +++ b/lldb/packages/Python/lldbsuite/test/dosep.py @@ -1557,7 +1557,9 @@ def main(print_details_on_success, num_threads, test_subdir, results_formatter.counts_by_test_result_status( EventBuilder.STATUS_FAILURE) + results_formatter.counts_by_test_result_status( - EventBuilder.STATUS_TIMEOUT) + EventBuilder.STATUS_TIMEOUT) + + results_formatter.counts_by_test_result_status( + EventBuilder.STATUS_EXCEPTIONAL_EXIT) ) # Return with appropriate result code |