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 import argparse | 9 import argparse |
10 import collections | 10 import collections |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 group.add_argument('--results-path', default='', | 135 group.add_argument('--results-path', default='', |
136 help='File path to download results to.') | 136 help='File path to download results to.') |
137 group.add_argument('--api-protocol', | 137 group.add_argument('--api-protocol', |
138 help='HTTP protocol to use. (http or https)') | 138 help='HTTP protocol to use. (http or https)') |
139 group.add_argument('--api-address', help='Address to send HTTP requests.') | 139 group.add_argument('--api-address', help='Address to send HTTP requests.') |
140 group.add_argument('--api-port', help='Port to send HTTP requests to.') | 140 group.add_argument('--api-port', help='Port to send HTTP requests to.') |
141 group.add_argument('--runner-type', default='', | 141 group.add_argument('--runner-type', default='', |
142 help='Type of test to run as.') | 142 help='Type of test to run as.') |
143 group.add_argument('--runner-package', default='', | 143 group.add_argument('--runner-package', default='', |
144 help='Package name of test.') | 144 help='Package name of test.') |
145 group.add_argument('--apk-under-test', default='apks/Chrome.apk', | 145 group.add_argument('--app-under-test', default='', |
146 help='APK to run tests on.') | 146 help='APK to run tests on.') |
147 | 147 |
148 api_secret_group = group.add_mutually_exclusive_group() | 148 api_secret_group = group.add_mutually_exclusive_group() |
149 api_secret_group.add_argument('--api-secret', default='', | 149 api_secret_group.add_argument('--api-secret', default='', |
150 help='API secret for remote devices.') | 150 help='API secret for remote devices.') |
151 api_secret_group.add_argument('--api-secret-file', default='', | 151 api_secret_group.add_argument('--api-secret-file', default='', |
152 help='Path to file that contains API secret.') | 152 help='Path to file that contains API secret.') |
153 | 153 |
154 api_key_group = group.add_mutually_exclusive_group() | 154 api_key_group = group.add_mutually_exclusive_group() |
155 api_key_group.add_argument('--api-key', default='', | 155 api_key_group.add_argument('--api-key', default='', |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 help='The relative filepath to a file containing ' | 309 help='The relative filepath to a file containing ' |
310 'command-line flags to set on the device') | 310 'command-line flags to set on the device') |
311 group.add_argument('--isolate_file_path', | 311 group.add_argument('--isolate_file_path', |
312 '--isolate-file-path', | 312 '--isolate-file-path', |
313 dest='isolate_file_path', | 313 dest='isolate_file_path', |
314 help='.isolate file path to override the default ' | 314 help='.isolate file path to override the default ' |
315 'path') | 315 'path') |
316 | 316 |
317 AddCommonOptions(parser) | 317 AddCommonOptions(parser) |
318 AddDeviceOptions(parser) | 318 AddDeviceOptions(parser) |
| 319 AddRemoteDeviceOptions(parser) |
319 | 320 |
320 | 321 |
321 def ProcessInstrumentationOptions(args): | 322 def ProcessInstrumentationOptions(args): |
322 """Processes options/arguments and populate |options| with defaults. | 323 """Processes options/arguments and populate |options| with defaults. |
323 | 324 |
324 Args: | 325 Args: |
325 args: argparse.Namespace object. | 326 args: argparse.Namespace object. |
326 | 327 |
327 Returns: | 328 Returns: |
328 An InstrumentationOptions named tuple which contains all options relevant to | 329 An InstrumentationOptions named tuple which contains all options relevant to |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
988 subparser = command_parsers.add_parser( | 989 subparser = command_parsers.add_parser( |
989 test_type, usage='%(prog)s [options]', help=config.help_txt) | 990 test_type, usage='%(prog)s [options]', help=config.help_txt) |
990 config.add_options_func(subparser) | 991 config.add_options_func(subparser) |
991 | 992 |
992 args = parser.parse_args() | 993 args = parser.parse_args() |
993 return RunTestsCommand(args, parser) | 994 return RunTestsCommand(args, parser) |
994 | 995 |
995 | 996 |
996 if __name__ == '__main__': | 997 if __name__ == '__main__': |
997 sys.exit(main()) | 998 sys.exit(main()) |
OLD | NEW |