| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 group.add_argument('--runner-package', | 142 group.add_argument('--runner-package', |
| 143 help='Package name of test.') | 143 help='Package name of test.') |
| 144 group.add_argument('--device-type', | 144 group.add_argument('--device-type', |
| 145 choices=constants.VALID_DEVICE_TYPES, | 145 choices=constants.VALID_DEVICE_TYPES, |
| 146 help=('Type of device to run on. iOS or android')) | 146 help=('Type of device to run on. iOS or android')) |
| 147 group.add_argument('--device-oem', action='append', | 147 group.add_argument('--device-oem', action='append', |
| 148 help='Device OEM to run on.') | 148 help='Device OEM to run on.') |
| 149 group.add_argument('--remote-device-file', | 149 group.add_argument('--remote-device-file', |
| 150 help=('File with JSON to select remote device. ' | 150 help=('File with JSON to select remote device. ' |
| 151 'Overrides all other flags.')) | 151 'Overrides all other flags.')) |
| 152 group.add_argument('--remote-device-timeout', type=int, |
| 153 help='Times to retry finding remote device') |
| 152 | 154 |
| 153 device_os_group = group.add_mutually_exclusive_group() | 155 device_os_group = group.add_mutually_exclusive_group() |
| 154 device_os_group.add_argument('--remote-device-minimum-os', | 156 device_os_group.add_argument('--remote-device-minimum-os', |
| 155 help='Minimum OS on device.') | 157 help='Minimum OS on device.') |
| 156 device_os_group.add_argument('--remote-device-os', action='append', | 158 device_os_group.add_argument('--remote-device-os', action='append', |
| 157 help='OS to have on the device.') | 159 help='OS to have on the device.') |
| 158 | 160 |
| 159 api_secret_group = group.add_mutually_exclusive_group() | 161 api_secret_group = group.add_mutually_exclusive_group() |
| 160 api_secret_group.add_argument('--api-secret', default='', | 162 api_secret_group.add_argument('--api-secret', default='', |
| 161 help='API secret for remote devices.') | 163 help='API secret for remote devices.') |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 args.extra_args) | 524 args.extra_args) |
| 523 | 525 |
| 524 def AddUirobotTestOptions(parser): | 526 def AddUirobotTestOptions(parser): |
| 525 """Adds uirobot test options to |option_parser|.""" | 527 """Adds uirobot test options to |option_parser|.""" |
| 526 group = parser.add_argument_group('Uirobot Test Options') | 528 group = parser.add_argument_group('Uirobot Test Options') |
| 527 | 529 |
| 528 group.add_argument('--app-under-test', required=True, | 530 group.add_argument('--app-under-test', required=True, |
| 529 help='APK to run tests on.') | 531 help='APK to run tests on.') |
| 530 group.add_argument( | 532 group.add_argument( |
| 531 '--minutes', default=5, type=int, | 533 '--minutes', default=5, type=int, |
| 532 help='Number of minutes to run uirobot test [default: %default].') | 534 help='Number of minutes to run uirobot test [default: %(default)s].') |
| 533 | 535 |
| 534 AddCommonOptions(parser) | 536 AddCommonOptions(parser) |
| 535 AddDeviceOptions(parser) | 537 AddDeviceOptions(parser) |
| 536 AddRemoteDeviceOptions(parser) | 538 AddRemoteDeviceOptions(parser) |
| 537 | 539 |
| 538 def AddPerfTestOptions(parser): | 540 def AddPerfTestOptions(parser): |
| 539 """Adds perf test options to |parser|.""" | 541 """Adds perf test options to |parser|.""" |
| 540 | 542 |
| 541 group = parser.add_argument_group('Perf Test Options') | 543 group = parser.add_argument_group('Perf Test Options') |
| 542 | 544 |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1009 subparser = command_parsers.add_parser( | 1011 subparser = command_parsers.add_parser( |
| 1010 test_type, usage='%(prog)s [options]', help=config.help_txt) | 1012 test_type, usage='%(prog)s [options]', help=config.help_txt) |
| 1011 config.add_options_func(subparser) | 1013 config.add_options_func(subparser) |
| 1012 | 1014 |
| 1013 args = parser.parse_args() | 1015 args = parser.parse_args() |
| 1014 return RunTestsCommand(args, parser) | 1016 return RunTestsCommand(args, parser) |
| 1015 | 1017 |
| 1016 | 1018 |
| 1017 if __name__ == '__main__': | 1019 if __name__ == '__main__': |
| 1018 sys.exit(main()) | 1020 sys.exit(main()) |
| OLD | NEW |