| 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 codecs | 5 import codecs |
| 6 import optparse | 6 import optparse |
| 7 import os | 7 import os |
| 8 import sys | 8 import sys |
| 9 import time | 9 import time |
| 10 | 10 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 def _GetProgressReporter(output_skipped_tests_summary, suppress_gtest_report): | 108 def _GetProgressReporter(output_skipped_tests_summary, suppress_gtest_report): |
| 109 if suppress_gtest_report: | 109 if suppress_gtest_report: |
| 110 return progress_reporter.ProgressReporter() | 110 return progress_reporter.ProgressReporter() |
| 111 | 111 |
| 112 return gtest_progress_reporter.GTestProgressReporter( | 112 return gtest_progress_reporter.GTestProgressReporter( |
| 113 sys.stdout, output_skipped_tests_summary=output_skipped_tests_summary) | 113 sys.stdout, output_skipped_tests_summary=output_skipped_tests_summary) |
| 114 | 114 |
| 115 | 115 |
| 116 def CreateResults(benchmark_metadata, options, | 116 def CreateResults(benchmark_metadata, options, |
| 117 value_can_be_added_predicate=lambda v, is_first: True): | 117 value_can_be_added_predicate=lambda v, is_first: True, |
| 118 benchmark_enabled=True): |
| 118 """ | 119 """ |
| 119 Args: | 120 Args: |
| 120 options: Contains the options specified in AddResultsOptions. | 121 options: Contains the options specified in AddResultsOptions. |
| 121 """ | 122 """ |
| 122 if not options.output_formats: | 123 if not options.output_formats: |
| 123 options.output_formats = [_OUTPUT_FORMAT_CHOICES[0]] | 124 options.output_formats = [_OUTPUT_FORMAT_CHOICES[0]] |
| 124 | 125 |
| 125 output_formatters = [] | 126 output_formatters = [] |
| 126 for output_format in options.output_formats: | 127 for output_format in options.output_formats: |
| 127 if output_format == 'none' or output_format == "gtest": | 128 if output_format == 'none' or output_format == "gtest": |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 # gtest. Let's try enabling skipped tests summary for gtest test | 161 # gtest. Let's try enabling skipped tests summary for gtest test |
| 161 # results too (in a separate patch), and see if we break anything. | 162 # results too (in a separate patch), and see if we break anything. |
| 162 output_skipped_tests_summary = 'gtest' in options.output_formats | 163 output_skipped_tests_summary = 'gtest' in options.output_formats |
| 163 | 164 |
| 164 reporter = _GetProgressReporter(output_skipped_tests_summary, | 165 reporter = _GetProgressReporter(output_skipped_tests_summary, |
| 165 options.suppress_gtest_report) | 166 options.suppress_gtest_report) |
| 166 | 167 |
| 167 results = page_test_results.PageTestResults( | 168 results = page_test_results.PageTestResults( |
| 168 output_formatters=output_formatters, progress_reporter=reporter, | 169 output_formatters=output_formatters, progress_reporter=reporter, |
| 169 output_dir=options.output_dir, | 170 output_dir=options.output_dir, |
| 170 value_can_be_added_predicate=value_can_be_added_predicate) | 171 value_can_be_added_predicate=value_can_be_added_predicate, |
| 172 benchmark_enabled=benchmark_enabled) |
| 171 | 173 |
| 172 results.iteration_info.benchmark_name = benchmark_metadata.name | 174 results.iteration_info.benchmark_name = benchmark_metadata.name |
| 173 results.iteration_info.benchmark_start_ms = time.time() * 1000.0 | 175 results.iteration_info.benchmark_start_ms = time.time() * 1000.0 |
| 174 if options.results_label: | 176 if options.results_label: |
| 175 results.iteration_info.label = options.results_label | 177 results.iteration_info.label = options.results_label |
| 176 | 178 |
| 177 return results | 179 return results |
| OLD | NEW |