| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Runner for Mojo application benchmarks.""" | 6 """Runner for Mojo application benchmarks.""" |
| 7 | 7 |
| 8 import argparse | 8 import argparse |
| 9 import json |
| 9 import logging | 10 import logging |
| 11 import os.path |
| 12 import re |
| 10 import sys | 13 import sys |
| 11 import time | 14 import time |
| 12 import os.path | |
| 13 import re | |
| 14 | 15 |
| 15 from devtoolslib import shell_arguments | 16 from devtoolslib import shell_arguments |
| 16 from devtoolslib import shell_config | 17 from devtoolslib import shell_config |
| 17 from devtoolslib import perf_dashboard | 18 from devtoolslib import perf_dashboard |
| 18 | 19 |
| 19 | 20 |
| 20 _DESCRIPTION = """Runner for Mojo application benchmarks. | 21 _DESCRIPTION = """Runner for Mojo application benchmarks. |
| 21 | 22 |
| 22 |benchmark_list_file| has to be a valid Python program that sets a |benchmarks| | 23 |benchmark_list_file| has to be a valid Python program that sets a |benchmarks| |
| 23 global variable, containing entries of the following form: | 24 global variable, containing entries of the following form: |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 print 'benchmark failed: ' + benchmark_error | 238 print 'benchmark failed: ' + benchmark_error |
| 238 if some_measurements_failed: | 239 if some_measurements_failed: |
| 239 print 'some measurements failed' | 240 print 'some measurements failed' |
| 240 print 'output: ' | 241 print 'output: ' |
| 241 print '-' * 72 | 242 print '-' * 72 |
| 242 print output | 243 print output |
| 243 print '-' * 72 | 244 print '-' * 72 |
| 244 exit_code = 1 | 245 exit_code = 1 |
| 245 | 246 |
| 246 if script_args.chart_data_output_file: | 247 if script_args.chart_data_output_file: |
| 247 script_args.chart_data_output_file.write(chart_data_recorder.get_json()) | 248 script_args.chart_data_output_file.write( |
| 249 json.dumps(chart_data_recorder.get_chart_data())) |
| 248 script_args.chart_data_output_file.write('\n') | 250 script_args.chart_data_output_file.write('\n') |
| 249 | 251 |
| 250 return exit_code | 252 return exit_code |
| 251 | 253 |
| 252 if __name__ == '__main__': | 254 if __name__ == '__main__': |
| 253 sys.exit(main()) | 255 sys.exit(main()) |
| OLD | NEW |