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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 group.add_argument('-e', '--environment', default='local', | 95 group.add_argument('-e', '--environment', default='local', |
96 choices=constants.VALID_ENVIRONMENTS, | 96 choices=constants.VALID_ENVIRONMENTS, |
97 help='Test environment to run in (default: %(default)s).') | 97 help='Test environment to run in (default: %(default)s).') |
98 group.add_argument('--adb-path', | 98 group.add_argument('--adb-path', |
99 help=('Specify the absolute path of the adb binary that ' | 99 help=('Specify the absolute path of the adb binary that ' |
100 'should be used.')) | 100 'should be used.')) |
101 group.add_argument('--json-results-file', dest='json_results_file', | 101 group.add_argument('--json-results-file', dest='json_results_file', |
102 help='If set, will dump results in JSON form ' | 102 help='If set, will dump results in JSON form ' |
103 'to specified file.') | 103 'to specified file.') |
104 | 104 |
105 | |
106 def ProcessCommonOptions(args): | 105 def ProcessCommonOptions(args): |
107 """Processes and handles all common options.""" | 106 """Processes and handles all common options.""" |
108 run_tests_helper.SetLogLevel(args.verbose_count) | 107 run_tests_helper.SetLogLevel(args.verbose_count) |
109 constants.SetBuildType(args.build_type) | 108 constants.SetBuildType(args.build_type) |
110 if args.build_directory: | 109 if args.build_directory: |
111 constants.SetBuildDirectory(args.build_directory) | 110 constants.SetBuildDirectory(args.build_directory) |
112 if args.output_directory: | 111 if args.output_directory: |
113 constants.SetOutputDirectort(args.output_directory) | 112 constants.SetOutputDirectort(args.output_directory) |
114 if args.adb_path: | 113 if args.adb_path: |
115 constants.SetAdbPath(args.adb_path) | 114 constants.SetAdbPath(args.adb_path) |
(...skipping 17 matching lines...) Expand all Loading... |
133 group.add_argument('--remote-device-os', default='', | 132 group.add_argument('--remote-device-os', default='', |
134 help='OS to have on the device.') | 133 help='OS to have on the device.') |
135 group.add_argument('--results-path', default='', | 134 group.add_argument('--results-path', default='', |
136 help='File path to download results to.') | 135 help='File path to download results to.') |
137 group.add_argument('--api-protocol', | 136 group.add_argument('--api-protocol', |
138 help='HTTP protocol to use. (http or https)') | 137 help='HTTP protocol to use. (http or https)') |
139 group.add_argument('--api-address', help='Address to send HTTP requests.') | 138 group.add_argument('--api-address', help='Address to send HTTP requests.') |
140 group.add_argument('--api-port', help='Port to send HTTP requests to.') | 139 group.add_argument('--api-port', help='Port to send HTTP requests to.') |
141 group.add_argument('--runner-type', default='', | 140 group.add_argument('--runner-type', default='', |
142 help='Type of test to run as.') | 141 help='Type of test to run as.') |
143 group.add_argument('--runner-package', default='', | 142 group.add_argument('--runner-package', help='Package name of test.') |
144 help='Package name of test.') | 143 group.add_argument('--app-under-test', help='APK to run tests on.') |
145 group.add_argument('--app-under-test', default='', | 144 group.add_argument('--device-type', default='Android', |
146 help='APK to run tests on.') | 145 choices=constants.VALID_DEVICE_TYPES, |
| 146 help=('Type of device to run on. iOS or android')) |
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='', |
156 help='API key for remote devices.') | 156 help='API key for remote devices.') |
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
989 subparser = command_parsers.add_parser( | 989 subparser = command_parsers.add_parser( |
990 test_type, usage='%(prog)s [options]', help=config.help_txt) | 990 test_type, usage='%(prog)s [options]', help=config.help_txt) |
991 config.add_options_func(subparser) | 991 config.add_options_func(subparser) |
992 | 992 |
993 args = parser.parse_args() | 993 args = parser.parse_args() |
994 return RunTestsCommand(args, parser) | 994 return RunTestsCommand(args, parser) |
995 | 995 |
996 | 996 |
997 if __name__ == '__main__': | 997 if __name__ == '__main__': |
998 sys.exit(main()) | 998 sys.exit(main()) |
OLD | NEW |