OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 """Parses the command line, discovers the appropriate benchmarks, and runs them. | 5 """Parses the command line, discovers the appropriate benchmarks, and runs them. |
6 | 6 |
7 Handles benchmark configuration, but all the logic for | 7 Handles benchmark configuration, but all the logic for |
8 actually running the benchmark is in Benchmark and PageRunner.""" | 8 actually running the benchmark is in Benchmark and PageRunner.""" |
9 | 9 |
10 import hashlib | 10 import hashlib |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 if args.browser_type in ( | 156 if args.browser_type in ( |
157 'exact', 'release', 'release_x64', 'debug', 'debug_x64', 'canary'): | 157 'exact', 'release', 'release_x64', 'debug', 'debug_x64', 'canary'): |
158 args.browser_type = 'reference' | 158 args.browser_type = 'reference' |
159 possible_reference_browser = browser_finder.FindBrowser(args) | 159 possible_reference_browser = browser_finder.FindBrowser(args) |
160 else: | 160 else: |
161 possible_reference_browser = None | 161 possible_reference_browser = None |
162 if args.json_output_file: | 162 if args.json_output_file: |
163 with open(args.json_output_file, 'w') as f: | 163 with open(args.json_output_file, 'w') as f: |
164 f.write(_GetJsonBenchmarkList(possible_browser, | 164 f.write(_GetJsonBenchmarkList(possible_browser, |
165 possible_reference_browser, | 165 possible_reference_browser, |
166 args.benchmarks, args.num_shards)) | 166 args.benchmarks, args.num_shards, |
| 167 args.blacklist_file)) |
167 else: | 168 else: |
168 PrintBenchmarkList(args.benchmarks, possible_browser) | 169 PrintBenchmarkList(args.benchmarks, possible_browser) |
169 return 0 | 170 return 0 |
170 | 171 |
171 | 172 |
172 class Run(command_line.OptparseCommand): | 173 class Run(command_line.OptparseCommand): |
173 """Run one or more benchmarks (default)""" | 174 """Run one or more benchmarks (default)""" |
174 | 175 |
175 usage = 'benchmark_name [page_set] [<options>]' | 176 usage = 'benchmark_name [page_set] [<options>]' |
176 | 177 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 | 411 |
411 # Parse and run the command. | 412 # Parse and run the command. |
412 parser = command.CreateParser() | 413 parser = command.CreateParser() |
413 command.AddCommandLineArgs(parser, environment) | 414 command.AddCommandLineArgs(parser, environment) |
414 options, args = parser.parse_args() | 415 options, args = parser.parse_args() |
415 if commands: | 416 if commands: |
416 args = args[1:] | 417 args = args[1:] |
417 options.positional_args = args | 418 options.positional_args = args |
418 command.ProcessCommandLineArgs(parser, options, environment) | 419 command.ProcessCommandLineArgs(parser, options, environment) |
419 return command().Run(options) | 420 return command().Run(options) |
OLD | NEW |