| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import json | 5 import json |
| 6 import logging | |
| 7 | 6 |
| 8 from pylib.base import base_test_result | 7 from pylib.base import base_test_result |
| 9 | 8 |
| 10 | 9 |
| 11 def GenerateResultsDict(test_run_result): | 10 def GenerateResultsDict(test_run_result): |
| 12 """Create a results dict from |test_run_result| suitable for writing to JSON. | 11 """Create a results dict from |test_run_result| suitable for writing to JSON. |
| 13 Args: | 12 Args: |
| 14 test_run_result: a base_test_result.TestRunResults object. | 13 test_run_result: a base_test_result.TestRunResults object. |
| 15 Returns: | 14 Returns: |
| 16 A results dict that mirrors the one generated by | 15 A results dict that mirrors the one generated by |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 testsuite_runs = json_results['per_iteration_data'] | 129 testsuite_runs = json_results['per_iteration_data'] |
| 131 for testsuite_run in testsuite_runs: | 130 for testsuite_run in testsuite_runs: |
| 132 for test, test_runs in testsuite_run.iteritems(): | 131 for test, test_runs in testsuite_run.iteritems(): |
| 133 results_list.extend( | 132 results_list.extend( |
| 134 [base_test_result.BaseTestResult(test, | 133 [base_test_result.BaseTestResult(test, |
| 135 string_as_status(tr['status']), | 134 string_as_status(tr['status']), |
| 136 duration=tr['elapsed_time_ms']) | 135 duration=tr['elapsed_time_ms']) |
| 137 for tr in test_runs]) | 136 for tr in test_runs]) |
| 138 return results_list | 137 return results_list |
| 139 | 138 |
| OLD | NEW |