| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 help='If set, will dump results in JSON form ' | 104 help='If set, will dump results in JSON form ' |
| 105 'to specified file.') | 105 'to specified file.') |
| 106 | 106 |
| 107 def ProcessCommonOptions(args): | 107 def ProcessCommonOptions(args): |
| 108 """Processes and handles all common options.""" | 108 """Processes and handles all common options.""" |
| 109 run_tests_helper.SetLogLevel(args.verbose_count) | 109 run_tests_helper.SetLogLevel(args.verbose_count) |
| 110 constants.SetBuildType(args.build_type) | 110 constants.SetBuildType(args.build_type) |
| 111 if args.build_directory: | 111 if args.build_directory: |
| 112 constants.SetBuildDirectory(args.build_directory) | 112 constants.SetBuildDirectory(args.build_directory) |
| 113 if args.output_directory: | 113 if args.output_directory: |
| 114 constants.SetOutputDirectort(args.output_directory) | 114 constants.SetOutputDirectory(args.output_directory) |
| 115 if args.adb_path: | 115 if args.adb_path: |
| 116 constants.SetAdbPath(args.adb_path) | 116 constants.SetAdbPath(args.adb_path) |
| 117 # Some things such as Forwarder require ADB to be in the environment path. | 117 # Some things such as Forwarder require ADB to be in the environment path. |
| 118 adb_dir = os.path.dirname(constants.GetAdbPath()) | 118 adb_dir = os.path.dirname(constants.GetAdbPath()) |
| 119 if adb_dir and adb_dir not in os.environ['PATH'].split(os.pathsep): | 119 if adb_dir and adb_dir not in os.environ['PATH'].split(os.pathsep): |
| 120 os.environ['PATH'] = adb_dir + os.pathsep + os.environ['PATH'] | 120 os.environ['PATH'] = adb_dir + os.pathsep + os.environ['PATH'] |
| 121 | 121 |
| 122 | 122 |
| 123 def AddRemoteDeviceOptions(parser): | 123 def AddRemoteDeviceOptions(parser): |
| 124 group = parser.add_argument_group('Remote Device Options') | 124 group = parser.add_argument_group('Remote Device Options') |
| (...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1031 return constants.INFRA_EXIT_CODE | 1031 return constants.INFRA_EXIT_CODE |
| 1032 else: | 1032 else: |
| 1033 return constants.ERROR_EXIT_CODE | 1033 return constants.ERROR_EXIT_CODE |
| 1034 except: # pylint: disable=W0702 | 1034 except: # pylint: disable=W0702 |
| 1035 logging.exception('Unrecognized error occurred.') | 1035 logging.exception('Unrecognized error occurred.') |
| 1036 return constants.ERROR_EXIT_CODE | 1036 return constants.ERROR_EXIT_CODE |
| 1037 | 1037 |
| 1038 | 1038 |
| 1039 if __name__ == '__main__': | 1039 if __name__ == '__main__': |
| 1040 sys.exit(main()) | 1040 sys.exit(main()) |
| OLD | NEW |