diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:04:10 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:04:10 +0000 |
commit | 74a628f776edb588bff8f8f5cc16eac947c9d631 (patch) | |
tree | dc32e010ac4902621e5a279bfeb48628f7f0e166 /packages/Python/lldbsuite/test_event | |
parent | afed7be32164a598f8172282c249af7266c48b46 (diff) | |
download | src-74a628f776edb588bff8f8f5cc16eac947c9d631.tar.gz src-74a628f776edb588bff8f8f5cc16eac947c9d631.zip |
Vendor import of lldb trunk r300422:vendor/lldb/lldb-trunk-r300422
Notes
Notes:
svn path=/vendor/lldb/dist/; revision=317027
svn path=/vendor/lldb/lldb-trunk-r300422/; revision=317028; tag=vendor/lldb/lldb-trunk-r300422
Diffstat (limited to 'packages/Python/lldbsuite/test_event')
-rw-r--r-- | packages/Python/lldbsuite/test_event/formatter/results_formatter.py | 31 | ||||
-rw-r--r-- | packages/Python/lldbsuite/test_event/formatter/xunit.py | 2 |
2 files changed, 5 insertions, 28 deletions
diff --git a/packages/Python/lldbsuite/test_event/formatter/results_formatter.py b/packages/Python/lldbsuite/test_event/formatter/results_formatter.py index 35a9fa8d5d56..8e341cb2ce84 100644 --- a/packages/Python/lldbsuite/test_event/formatter/results_formatter.py +++ b/packages/Python/lldbsuite/test_event/formatter/results_formatter.py @@ -126,19 +126,6 @@ class ResultsFormatter(object): self.terminate_called = False self.file_is_stream = file_is_stream - # Store counts of test_result events by status. - self.result_status_counts = { - EventBuilder.STATUS_SUCCESS: 0, - EventBuilder.STATUS_EXPECTED_FAILURE: 0, - EventBuilder.STATUS_EXPECTED_TIMEOUT: 0, - EventBuilder.STATUS_SKIP: 0, - EventBuilder.STATUS_UNEXPECTED_SUCCESS: 0, - EventBuilder.STATUS_FAILURE: 0, - EventBuilder.STATUS_ERROR: 0, - EventBuilder.STATUS_TIMEOUT: 0, - EventBuilder.STATUS_EXCEPTIONAL_EXIT: 0 - } - # Track the most recent test start event by worker index. # We'll use this to assign TIMEOUT and exceptional # exits to the most recent test started on a given @@ -359,18 +346,12 @@ class ResultsFormatter(object): if event_type == "terminate": self.terminate_called = True elif event_type in EventBuilder.RESULT_TYPES: - # Keep track of event counts per test/job result status - # type. The only job (i.e. inferior process) results that - # make it here are ones that cannot be remapped to the most - # recently started test for the given worker index. - status = test_event["status"] - self.result_status_counts[status] += 1 # Clear the most recently started test for the related # worker. worker_index = test_event.get("worker_index", None) if worker_index is not None: self.started_tests_by_worker.pop(worker_index, None) - + status = test_event["status"] if status in EventBuilder.TESTRUN_ERROR_STATUS_VALUES: # A test/job status value in any of those status values # causes a testrun failure. If such a test fails, check @@ -393,12 +374,6 @@ class ResultsFormatter(object): # the need to run a low-load, single-worker test run can # have the final run's results to always be used. if test_key in self.result_events: - # We are replacing the result of something that was - # already counted by the base class. Remove the double - # counting by reducing by one the count for the test - # result status. - old_status = self.result_events[test_key]["status"] - self.result_status_counts[old_status] -= 1 self.test_method_rerun_count += 1 self.result_events[test_key] = test_event elif event_type == EventBuilder.TYPE_TEST_START: @@ -494,7 +469,9 @@ class ResultsFormatter(object): @return an integer returning the number of test methods matching the given test result status. """ - return self.result_status_counts[status] + return len([ + [key, event] for (key, event) in self.result_events.items() + if event.get("status", "") == status]) @classmethod def _event_sort_key(cls, event): diff --git a/packages/Python/lldbsuite/test_event/formatter/xunit.py b/packages/Python/lldbsuite/test_event/formatter/xunit.py index d3ea8677f0a6..91487cd2c3a1 100644 --- a/packages/Python/lldbsuite/test_event/formatter/xunit.py +++ b/packages/Python/lldbsuite/test_event/formatter/xunit.py @@ -336,7 +336,7 @@ class XunitFormatter(ResultsFormatter): test_event, inner_content=( '<error type={} message={}></error>'.format( - "timeout", + XunitFormatter._quote_attribute("timeout"), XunitFormatter._quote_attribute(message)) )) with self.lock: |