OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2013 The Chromium Authors. All rights reserved. | 3 # Copyright 2013 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Runs all types of tests from one unified interface. | 7 """Runs all types of tests from one unified interface. |
8 | 8 |
9 TODO(gkanwar): | 9 TODO(gkanwar): |
10 * Add options to run Monkey tests. | 10 * Add options to run Monkey tests. |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
243 action='store_true', | 243 action='store_true', |
244 help='Wait for debugger.') | 244 help='Wait for debugger.') |
245 #TODO(craigdh): Remove option once -I is no longer passed downstream. | 245 #TODO(craigdh): Remove option once -I is no longer passed downstream. |
246 option_parser.add_option('-I', dest='install_apk', action='store_true', | 246 option_parser.add_option('-I', dest='install_apk', action='store_true', |
247 help='(DEPRECATED) Install the test apk.') | 247 help='(DEPRECATED) Install the test apk.') |
248 option_parser.add_option( | 248 option_parser.add_option( |
249 '--test-apk', dest='test_apk', | 249 '--test-apk', dest='test_apk', |
250 help=('The name of the apk containing the tests ' | 250 help=('The name of the apk containing the tests ' |
251 '(without the .apk extension; e.g. "ContentShellTest"). ' | 251 '(without the .apk extension; e.g. "ContentShellTest"). ' |
252 'Alternatively, this can be a full path to the apk.')) | 252 'Alternatively, this can be a full path to the apk.')) |
253 option_parser.add_option('--coverage_dir', | |
frankf
2013/08/01 19:57:41
--coverage-dir
gkanwar1
2013/08/07 19:24:56
Done.
| |
254 help=('Directory in which to place all generated ' | |
255 'EMMA coverage files.')) | |
253 | 256 |
254 | 257 |
255 def ProcessInstrumentationOptions(options, error_func): | 258 def ProcessInstrumentationOptions(options, error_func): |
256 """Processes options/arguments and populate |options| with defaults.""" | 259 """Processes options/arguments and populate |options| with defaults.""" |
257 | 260 |
258 ProcessJavaTestOptions(options, error_func) | 261 ProcessJavaTestOptions(options, error_func) |
259 | 262 |
260 if not options.test_apk: | 263 if not options.test_apk: |
261 error_func('--test-apk must be specified.') | 264 error_func('--test-apk must be specified.') |
262 | 265 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
360 | 363 |
361 results = base_test_result.TestRunResults() | 364 results = base_test_result.TestRunResults() |
362 exit_code = 0 | 365 exit_code = 0 |
363 | 366 |
364 if options.run_java_tests: | 367 if options.run_java_tests: |
365 runner_factory, tests = instrumentation_setup.Setup( | 368 runner_factory, tests = instrumentation_setup.Setup( |
366 options.test_apk_path, options.test_apk_jar_path, options.annotations, | 369 options.test_apk_path, options.test_apk_jar_path, options.annotations, |
367 options.exclude_annotations, options.test_filter, options.build_type, | 370 options.exclude_annotations, options.test_filter, options.build_type, |
368 options.test_data, options.save_perf_json, options.screenshot_failures, | 371 options.test_data, options.save_perf_json, options.screenshot_failures, |
369 options.tool, options.wait_for_debugger, options.disable_assertions, | 372 options.tool, options.wait_for_debugger, options.disable_assertions, |
370 options.push_deps, options.cleanup_test_files) | 373 options.push_deps, options.cleanup_test_files, options.coverage_dir) |
371 | 374 |
372 test_results, exit_code = test_dispatcher.RunTests( | 375 test_results, exit_code = test_dispatcher.RunTests( |
373 tests, runner_factory, options.wait_for_debugger, | 376 tests, runner_factory, options.wait_for_debugger, |
374 options.test_device, | 377 options.test_device, |
375 shard=True, | 378 shard=True, |
376 build_type=options.build_type, | 379 build_type=options.build_type, |
377 test_timeout=None, | 380 test_timeout=None, |
378 num_retries=options.num_retries) | 381 num_retries=options.num_retries) |
379 | 382 |
380 results.AddTestRunResults(test_results) | 383 results.AddTestRunResults(test_results) |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
576 return 0 | 579 return 0 |
577 command = argv[1] | 580 command = argv[1] |
578 VALID_COMMANDS[command].add_options_func(option_parser) | 581 VALID_COMMANDS[command].add_options_func(option_parser) |
579 options, args = option_parser.parse_args(argv) | 582 options, args = option_parser.parse_args(argv) |
580 return VALID_COMMANDS[command].run_command_func( | 583 return VALID_COMMANDS[command].run_command_func( |
581 command, options, args, option_parser) | 584 command, options, args, option_parser) |
582 | 585 |
583 | 586 |
584 if __name__ == '__main__': | 587 if __name__ == '__main__': |
585 sys.exit(main(sys.argv)) | 588 sys.exit(main(sys.argv)) |
OLD | NEW |