| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 logcat_output_group.add_argument( | 118 logcat_output_group.add_argument( |
| 119 '--logcat-output-file', | 119 '--logcat-output-file', |
| 120 help='If set, will merge logcats recorded during test run and dump them ' | 120 help='If set, will merge logcats recorded during test run and dump them ' |
| 121 'to the specified file.') | 121 'to the specified file.') |
| 122 | 122 |
| 123 class FastLocalDevAction(argparse.Action): | 123 class FastLocalDevAction(argparse.Action): |
| 124 def __call__(self, parser, namespace, values, option_string=None): | 124 def __call__(self, parser, namespace, values, option_string=None): |
| 125 namespace.verbose_count = max(namespace.verbose_count, 1) | 125 namespace.verbose_count = max(namespace.verbose_count, 1) |
| 126 namespace.num_retries = 0 | 126 namespace.num_retries = 0 |
| 127 namespace.enable_device_cache = True | 127 namespace.enable_device_cache = True |
| 128 namespace.enable_concurrent_adb = True |
| 128 namespace.skip_clear_data = True | 129 namespace.skip_clear_data = True |
| 129 namespace.extract_test_list_from_filter = True | 130 namespace.extract_test_list_from_filter = True |
| 130 | 131 |
| 131 group.add_argument('--fast-local-dev', type=bool, nargs=0, | 132 group.add_argument('--fast-local-dev', type=bool, nargs=0, |
| 132 action=FastLocalDevAction, | 133 action=FastLocalDevAction, |
| 133 help='Alias for: --verbose --num-retries=0 ' | 134 help='Alias for: --verbose --num-retries=0 ' |
| 134 '--enable-device-cache --skip-clear-data ' | 135 '--enable-device-cache --enable-concurrent-adb ' |
| 135 '--extract-test-list-from-filter') | 136 '--skip-clear-data --extract-test-list-from-filter') |
| 136 | 137 |
| 137 def ProcessCommonOptions(args): | 138 def ProcessCommonOptions(args): |
| 138 """Processes and handles all common options.""" | 139 """Processes and handles all common options.""" |
| 139 run_tests_helper.SetLogLevel(args.verbose_count) | 140 run_tests_helper.SetLogLevel(args.verbose_count) |
| 140 constants.SetBuildType(args.build_type) | 141 constants.SetBuildType(args.build_type) |
| 141 if args.build_directory: | 142 if args.build_directory: |
| 142 constants.SetBuildDirectory(args.build_directory) | 143 constants.SetBuildDirectory(args.build_directory) |
| 143 if args.output_directory: | 144 if args.output_directory: |
| 144 constants.SetOutputDirectory(args.output_directory) | 145 constants.SetOutputDirectory(args.output_directory) |
| 145 | 146 |
| (...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1127 if e.is_infra_error: | 1128 if e.is_infra_error: |
| 1128 return constants.INFRA_EXIT_CODE | 1129 return constants.INFRA_EXIT_CODE |
| 1129 return constants.ERROR_EXIT_CODE | 1130 return constants.ERROR_EXIT_CODE |
| 1130 except: # pylint: disable=W0702 | 1131 except: # pylint: disable=W0702 |
| 1131 logging.exception('Unrecognized error occurred.') | 1132 logging.exception('Unrecognized error occurred.') |
| 1132 return constants.ERROR_EXIT_CODE | 1133 return constants.ERROR_EXIT_CODE |
| 1133 | 1134 |
| 1134 | 1135 |
| 1135 if __name__ == '__main__': | 1136 if __name__ == '__main__': |
| 1136 sys.exit(main()) | 1137 sys.exit(main()) |
| OLD | NEW |