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 import argparse | 9 import argparse |
| 10 import collections | 10 import collections |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 106 help=('Specify the absolute path of the adb binary that ' | 106 help=('Specify the absolute path of the adb binary that ' |
| 107 'should be used.')) | 107 'should be used.')) |
| 108 group.add_argument('--json-results-file', '--test-launcher-summary-output', | 108 group.add_argument('--json-results-file', '--test-launcher-summary-output', |
| 109 dest='json_results_file', | 109 dest='json_results_file', |
| 110 help='If set, will dump results in JSON form ' | 110 help='If set, will dump results in JSON form ' |
| 111 'to specified file.') | 111 'to specified file.') |
| 112 group.add_argument('--logcat-output-dir', | 112 group.add_argument('--logcat-output-dir', |
| 113 help='If set, will dump logcats recorded during test run ' | 113 help='If set, will dump logcats recorded during test run ' |
| 114 'to directory. File names will be the device ids.') | 114 'to directory. File names will be the device ids.') |
| 115 | 115 |
| 116 class FastLocalDevAction(argparse.Action): | |
|
jbudorick
2016/02/04 05:34:24
I would normally be against a local class, but thi
agrieve
2016/02/04 16:09:14
Yeah, there's another one already on line 607, so
| |
| 117 def __call__(self, parser, namespace, values, option_string=None): | |
| 118 namespace.verbose_count = max(namespace.verbose_count, 1) | |
| 119 namespace.num_retries = 0 | |
| 120 namespace.enable_device_cache = True | |
| 121 namespace.skip_clear_data = True | |
| 122 namespace.extract_test_list_from_filter = True | |
| 123 | |
| 124 group.add_argument('--fast-local-dev', type=bool, nargs=0, | |
| 125 action=FastLocalDevAction, | |
| 126 help='Alias for: --verbose --num-retries=0 ' | |
| 127 '--enable-device-cache --skip-clear-data ' | |
| 128 '--extract-test-list-from-filter') | |
| 129 | |
| 116 def ProcessCommonOptions(args): | 130 def ProcessCommonOptions(args): |
| 117 """Processes and handles all common options.""" | 131 """Processes and handles all common options.""" |
| 132 | |
| 118 run_tests_helper.SetLogLevel(args.verbose_count) | 133 run_tests_helper.SetLogLevel(args.verbose_count) |
| 119 constants.SetBuildType(args.build_type) | 134 constants.SetBuildType(args.build_type) |
| 120 if args.build_directory: | 135 if args.build_directory: |
| 121 constants.SetBuildDirectory(args.build_directory) | 136 constants.SetBuildDirectory(args.build_directory) |
| 122 if args.output_directory: | 137 if args.output_directory: |
| 123 constants.SetOutputDirectory(args.output_directory) | 138 constants.SetOutputDirectory(args.output_directory) |
| 124 | 139 |
| 125 devil_custom_deps = None | 140 devil_custom_deps = None |
| 126 if args.adb_path: | 141 if args.adb_path: |
| 127 devil_custom_deps = { | 142 devil_custom_deps = { |
| (...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1106 if e.is_infra_error: | 1121 if e.is_infra_error: |
| 1107 return constants.INFRA_EXIT_CODE | 1122 return constants.INFRA_EXIT_CODE |
| 1108 return constants.ERROR_EXIT_CODE | 1123 return constants.ERROR_EXIT_CODE |
| 1109 except: # pylint: disable=W0702 | 1124 except: # pylint: disable=W0702 |
| 1110 logging.exception('Unrecognized error occurred.') | 1125 logging.exception('Unrecognized error occurred.') |
| 1111 return constants.ERROR_EXIT_CODE | 1126 return constants.ERROR_EXIT_CODE |
| 1112 | 1127 |
| 1113 | 1128 |
| 1114 if __name__ == '__main__': | 1129 if __name__ == '__main__': |
| 1115 sys.exit(main()) | 1130 sys.exit(main()) |
| OLD | NEW |