Chromium Code Reviews| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 259 if not options.keep_test_server_ports: | 259 if not options.keep_test_server_ports: |
| 260 if not ports.ResetTestServerPortAllocation(): | 260 if not ports.ResetTestServerPortAllocation(): |
| 261 raise Exception('Failed to reset test server port.') | 261 raise Exception('Failed to reset test server port.') |
| 262 | 262 |
| 263 | 263 |
| 264 def AddInstrumentationTestOptions(option_parser): | 264 def AddInstrumentationTestOptions(option_parser): |
| 265 """Adds Instrumentation test options to |option_parser|.""" | 265 """Adds Instrumentation test options to |option_parser|.""" |
| 266 | 266 |
| 267 option_parser.usage = '%prog instrumentation [options]' | 267 option_parser.usage = '%prog instrumentation [options]' |
| 268 option_parser.command_list = [] | 268 option_parser.command_list = [] |
| 269 option_parser.example = ('%prog instrumentation -I ' | 269 option_parser.example = ('%prog instrumentation ' |
| 270 '--test-apk=ChromiumTestShellTest') | 270 '--test-apk=ChromiumTestShellTest') |
| 271 | 271 |
| 272 AddJavaTestOptions(option_parser) | 272 AddJavaTestOptions(option_parser) |
| 273 AddCommonOptions(option_parser) | 273 AddCommonOptions(option_parser) |
| 274 | 274 |
| 275 option_parser.add_option('-w', '--wait_debugger', dest='wait_for_debugger', | 275 option_parser.add_option('-w', '--wait_debugger', dest='wait_for_debugger', |
| 276 action='store_true', | 276 action='store_true', |
| 277 help='Wait for debugger.') | 277 help='Wait for debugger.') |
| 278 #TODO(craigdh): Remove option once -I is no longer passed downstream. | |
| 278 option_parser.add_option('-I', dest='install_apk', action='store_true', | 279 option_parser.add_option('-I', dest='install_apk', action='store_true', |
| 279 help='Install test APK.') | 280 help='This switch has no effect.') |
|
frankf
2013/07/19 21:53:54
Follow the DEPRECATED used elsewhere in this file.
craigdh
2013/07/19 23:38:38
Done.
| |
| 280 option_parser.add_option( | 281 option_parser.add_option( |
| 281 '--test-apk', dest='test_apk', | 282 '--test-apk', dest='test_apk', |
| 282 help=('The name of the apk containing the tests ' | 283 help=('The name of the apk containing the tests ' |
| 283 '(without the .apk extension; e.g. "ContentShellTest"). ' | 284 '(without the .apk extension; e.g. "ContentShellTest"). ' |
| 284 'Alternatively, this can be a full path to the apk.')) | 285 'Alternatively, this can be a full path to the apk.')) |
| 285 | 286 |
| 286 | 287 |
| 287 def ProcessInstrumentationOptions(options, error_func): | 288 def ProcessInstrumentationOptions(options, error_func): |
| 288 """Processes options/arguments and populate |options| with defaults.""" | 289 """Processes options/arguments and populate |options| with defaults.""" |
| 289 | 290 |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 526 return 0 | 527 return 0 |
| 527 command = argv[1] | 528 command = argv[1] |
| 528 VALID_COMMANDS[command].add_options_func(option_parser) | 529 VALID_COMMANDS[command].add_options_func(option_parser) |
| 529 options, args = option_parser.parse_args(argv) | 530 options, args = option_parser.parse_args(argv) |
| 530 return VALID_COMMANDS[command].run_command_func( | 531 return VALID_COMMANDS[command].run_command_func( |
| 531 command, options, args, option_parser) | 532 command, options, args, option_parser) |
| 532 | 533 |
| 533 | 534 |
| 534 if __name__ == '__main__': | 535 if __name__ == '__main__': |
| 535 sys.exit(main(sys.argv)) | 536 sys.exit(main(sys.argv)) |
| OLD | NEW |