Processes test run output and updates result tracker. Args: output: Output object from the test run. result_tracker: ResultTracker object to be updated. count: Index of the test run (used for better logging).
(self, output, result_tracker)
| 523 | """ |
| 524 | |
| 525 | def ConsumeOutput(self, output, result_tracker): |
| 526 | """Processes test run output and updates result tracker. |
| 527 | |
| 528 | Args: |
| 529 | output: Output object from the test run. |
| 530 | result_tracker: ResultTracker object to be updated. |
| 531 | count: Index of the test run (used for better logging). |
| 532 | """ |
| 533 | results_for_total = [] |
| 534 | for trace in self.children: |
| 535 | result = trace.ConsumeOutput(output, result_tracker) |
| 536 | if result is not None: |
| 537 | results_for_total.append(result) |
| 538 | |
| 539 | if self.total: |
| 540 | # Produce total metric only when all traces have produced results. |
| 541 | if len(self.children) != len(results_for_total): |
| 542 | result_tracker.AddError( |
| 543 | 'Not all traces have produced results. Can not compute total for ' |
| 544 | '%s.' % self.name) |
| 545 | return |
| 546 | |
| 547 | # Calculate total as a the geometric mean for results from all traces. |
| 548 | total_trace = LeafTraceConfig( |
| 549 | { |
| 550 | 'name': 'Total', |
| 551 | 'units': self.children[0].units |
| 552 | }, self, self.arch) |
| 553 | result_tracker.AddTraceResult(total_trace, |
| 554 | GeometricMean(results_for_total), '') |
| 555 | |
| 556 | def AppendChild(self, node): |
| 557 | if node.__class__ not in (TraceConfig, LeafTraceConfig): |
no test coverage detected