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 optparse | 5 import optparse |
6 import os | 6 import os |
7 import sys | 7 import sys |
8 | 8 |
9 from telemetry.core import util | 9 from telemetry.core import util |
10 from telemetry.results import buildbot_output_formatter | 10 from telemetry.results import buildbot_output_formatter |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 # through the results easily without needing to open the html | 138 # through the results easily without needing to open the html |
139 # file. Another option for this is to output the results directly | 139 # file. Another option for this is to output the results directly |
140 # in gtest-style results (via some sort of progress reporter), | 140 # in gtest-style results (via some sort of progress reporter), |
141 # as we plan to enable gtest-style output for all output formatters. | 141 # as we plan to enable gtest-style output for all output formatters. |
142 output_formatters.append( | 142 output_formatters.append( |
143 buildbot_output_formatter.BuildbotOutputFormatter( | 143 buildbot_output_formatter.BuildbotOutputFormatter( |
144 sys.stdout, trace_tag=options.output_trace_tag)) | 144 sys.stdout, trace_tag=options.output_trace_tag)) |
145 output_formatters.append(html_output_formatter.HtmlOutputFormatter( | 145 output_formatters.append(html_output_formatter.HtmlOutputFormatter( |
146 output_stream, benchmark_metadata, options.reset_results, | 146 output_stream, benchmark_metadata, options.reset_results, |
147 options.upload_results, options.browser_type, | 147 options.upload_results, options.browser_type, |
148 options.results_label, trace_tag=options.output_trace_tag)) | 148 options.results_label)) |
149 elif output_format == 'json': | 149 elif output_format == 'json': |
150 output_formatters.append(json_output_formatter.JsonOutputFormatter( | 150 output_formatters.append(json_output_formatter.JsonOutputFormatter( |
151 output_stream, benchmark_metadata)) | 151 output_stream, benchmark_metadata)) |
152 elif output_format == 'chartjson': | 152 elif output_format == 'chartjson': |
153 output_formatters.append( | 153 output_formatters.append( |
154 chart_json_output_formatter.ChartJsonOutputFormatter( | 154 chart_json_output_formatter.ChartJsonOutputFormatter( |
155 output_stream, benchmark_metadata)) | 155 output_stream, benchmark_metadata)) |
156 else: | 156 else: |
157 # Should never be reached. The parser enforces the choices. | 157 # Should never be reached. The parser enforces the choices. |
158 raise Exception('Invalid --output-format "%s". Valid choices are: %s' | 158 raise Exception('Invalid --output-format "%s". Valid choices are: %s' |
159 % (output_format, ', '.join(_OUTPUT_FORMAT_CHOICES))) | 159 % (output_format, ', '.join(_OUTPUT_FORMAT_CHOICES))) |
160 | 160 |
161 # TODO(chrishenry): This is here to not change the output of | 161 # TODO(chrishenry): This is here to not change the output of |
162 # gtest. Let's try enabling skipped tests summary for gtest test | 162 # gtest. Let's try enabling skipped tests summary for gtest test |
163 # results too (in a separate patch), and see if we break anything. | 163 # results too (in a separate patch), and see if we break anything. |
164 output_skipped_tests_summary = 'gtest' in options.output_formats | 164 output_skipped_tests_summary = 'gtest' in options.output_formats |
165 | 165 |
166 reporter = _GetProgressReporter(output_skipped_tests_summary, | 166 reporter = _GetProgressReporter(output_skipped_tests_summary, |
167 options.suppress_gtest_report) | 167 options.suppress_gtest_report) |
168 return page_test_results.PageTestResults( | 168 return page_test_results.PageTestResults( |
169 output_formatters=output_formatters, progress_reporter=reporter, | 169 output_formatters=output_formatters, progress_reporter=reporter, |
170 output_dir=options.output_dir, | 170 output_dir=options.output_dir, |
171 value_can_be_added_predicate=value_can_be_added_predicate) | 171 value_can_be_added_predicate=value_can_be_added_predicate) |
OLD | NEW |