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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 61 option_parser.add_option('--num_retries', dest='num_retries', type='int', | 61 option_parser.add_option('--num_retries', dest='num_retries', type='int', |
| 62 default=2, | 62 default=2, |
| 63 help=('Number of retries for a test before ' | 63 help=('Number of retries for a test before ' |
| 64 'giving up.')) | 64 'giving up.')) |
| 65 option_parser.add_option('-v', | 65 option_parser.add_option('-v', |
| 66 '--verbose', | 66 '--verbose', |
| 67 dest='verbose_count', | 67 dest='verbose_count', |
| 68 default=0, | 68 default=0, |
| 69 action='count', | 69 action='count', |
| 70 help='Verbose level (multiple times for more)') | 70 help='Verbose level (multiple times for more)') |
| 71 profilers = ['devicestatsmonitor', 'chrometrace', 'dumpheap', 'smaps', | |
| 72 'traceview'] | |
| 73 option_parser.add_option('--profiler', dest='profilers', action='append', | |
| 74 choices=profilers, | |
| 75 help=('Profiling tool to run during test. Pass ' | |
| 76 'multiple times to run multiple profilers. ' | |
| 77 'Available profilers: %s' % profilers)) | |
| 78 option_parser.add_option('--tool', | 71 option_parser.add_option('--tool', |
| 79 dest='tool', | 72 dest='tool', |
| 80 help=('Run the test under a tool ' | 73 help=('Run the test under a tool ' |
| 81 '(use --tool help to list them)')) | 74 '(use --tool help to list them)')) |
| 82 option_parser.add_option('--flakiness-dashboard-server', | 75 option_parser.add_option('--flakiness-dashboard-server', |
| 83 dest='flakiness_dashboard_server', | 76 dest='flakiness_dashboard_server', |
| 84 help=('Address of the server that is hosting the ' | 77 help=('Address of the server that is hosting the ' |
| 85 'Chrome for Android flakiness dashboard.')) | 78 'Chrome for Android flakiness dashboard.')) |
| 86 option_parser.add_option('--skip-deps-push', dest='push_deps', | 79 option_parser.add_option('--skip-deps-push', dest='push_deps', |
| 87 action='store_false', default=True, | 80 action='store_false', default=True, |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 help='Saves the JSON file for each UI Perf test.') | 159 help='Saves the JSON file for each UI Perf test.') |
| 167 option_parser.add_option('--official-build', action='store_true', | 160 option_parser.add_option('--official-build', action='store_true', |
| 168 help='Run official build tests.') | 161 help='Run official build tests.') |
| 169 option_parser.add_option('--keep_test_server_ports', | 162 option_parser.add_option('--keep_test_server_ports', |
| 170 action='store_true', | 163 action='store_true', |
| 171 help=('Indicates the test server ports must be ' | 164 help=('Indicates the test server ports must be ' |
| 172 'kept. When this is run via a sharder ' | 165 'kept. When this is run via a sharder ' |
| 173 'the test server ports should be kept and ' | 166 'the test server ports should be kept and ' |
| 174 'should not be reset.')) | 167 'should not be reset.')) |
| 175 # TODO(gkanwar): This option is deprecated. Remove it in the future. | 168 # TODO(gkanwar): This option is deprecated. Remove it in the future. |
| 176 option_parser.add_option('--disable_assertions', action='store_true', | 169 option_parser.add_option('--disable_assertions', action='store_true', |
|
frankf
2013/08/07 22:50:20
Can you also remove this while you're here.
gkanwar1
2013/08/07 22:58:12
Done.
| |
| 177 help=('(DEPRECATED) Run with java assertions ' | 170 help=('(DEPRECATED) Run with java assertions ' |
| 178 'disabled.')) | 171 'disabled.')) |
| 179 option_parser.add_option('--test_data', action='append', default=[], | 172 option_parser.add_option('--test_data', action='append', default=[], |
| 180 help=('Each instance defines a directory of test ' | 173 help=('Each instance defines a directory of test ' |
| 181 'data that should be copied to the target(s) ' | 174 'data that should be copied to the target(s) ' |
| 182 'before running the tests. The argument ' | 175 'before running the tests. The argument ' |
| 183 'should be of the form <target>:<source>, ' | 176 'should be of the form <target>:<source>, ' |
| 184 '<target> is relative to the device data' | 177 '<target> is relative to the device data' |
| 185 'directory, and <source> is relative to the ' | 178 'directory, and <source> is relative to the ' |
| 186 'chromium build directory.')) | 179 'chromium build directory.')) |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 223 option_parser.add_option('-p', '--python_only', action='store_true', | 216 option_parser.add_option('-p', '--python_only', action='store_true', |
| 224 default=False, | 217 default=False, |
| 225 help='Run only the host-driven tests.') | 218 help='Run only the host-driven tests.') |
| 226 option_parser.add_option('--python_test_root', | 219 option_parser.add_option('--python_test_root', |
| 227 help='Root of the host-driven tests.') | 220 help='Root of the host-driven tests.') |
| 228 option_parser.add_option('-w', '--wait_debugger', dest='wait_for_debugger', | 221 option_parser.add_option('-w', '--wait_debugger', dest='wait_for_debugger', |
| 229 action='store_true', | 222 action='store_true', |
| 230 help='Wait for debugger.') | 223 help='Wait for debugger.') |
| 231 #TODO(craigdh): Remove option once -I is no longer passed downstream. | 224 #TODO(craigdh): Remove option once -I is no longer passed downstream. |
| 232 option_parser.add_option('-I', dest='install_apk', action='store_true', | 225 option_parser.add_option('-I', dest='install_apk', action='store_true', |
| 233 help='(DEPRECATED) Install the test apk.') | 226 help='(DEPRECATED) Install the test apk.') |
|
frankf
2013/08/07 22:50:20
Same with this.
gkanwar1
2013/08/07 22:58:12
Done.
| |
| 234 option_parser.add_option( | 227 option_parser.add_option( |
| 235 '--test-apk', dest='test_apk', | 228 '--test-apk', dest='test_apk', |
| 236 help=('The name of the apk containing the tests ' | 229 help=('The name of the apk containing the tests ' |
| 237 '(without the .apk extension; e.g. "ContentShellTest"). ' | 230 '(without the .apk extension; e.g. "ContentShellTest"). ' |
| 238 'Alternatively, this can be a full path to the apk.')) | 231 'Alternatively, this can be a full path to the apk.')) |
| 239 | 232 |
| 240 | 233 |
| 241 def ProcessInstrumentationOptions(options, error_func): | 234 def ProcessInstrumentationOptions(options, error_func): |
| 242 """Processes options/arguments and populate |options| with defaults. | 235 """Processes options/arguments and populate |options| with defaults. |
| 243 | 236 |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 617 return 0 | 610 return 0 |
| 618 command = argv[1] | 611 command = argv[1] |
| 619 VALID_COMMANDS[command].add_options_func(option_parser) | 612 VALID_COMMANDS[command].add_options_func(option_parser) |
| 620 options, args = option_parser.parse_args(argv) | 613 options, args = option_parser.parse_args(argv) |
| 621 return VALID_COMMANDS[command].run_command_func( | 614 return VALID_COMMANDS[command].run_command_func( |
| 622 command, options, args, option_parser) | 615 command, options, args, option_parser) |
| 623 | 616 |
| 624 | 617 |
| 625 if __name__ == '__main__': | 618 if __name__ == '__main__': |
| 626 sys.exit(main(sys.argv)) | 619 sys.exit(main(sys.argv)) |
| OLD | NEW |