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 |
11 import itertools | 11 import itertools |
12 import logging | 12 import logging |
13 import os | 13 import os |
14 import signal | 14 import signal |
15 import sys | 15 import sys |
16 import threading | 16 import threading |
17 import unittest | 17 import unittest |
18 | 18 |
19 import devil_chromium | 19 import devil_chromium |
20 | 20 |
21 from devil import base_error | 21 from devil import base_error |
| 22 from devil import devil_env |
22 from devil.android import apk_helper | 23 from devil.android import apk_helper |
23 from devil.android import device_blacklist | 24 from devil.android import device_blacklist |
24 from devil.android import device_errors | 25 from devil.android import device_errors |
25 from devil.android import device_utils | 26 from devil.android import device_utils |
26 from devil.android import ports | 27 from devil.android import ports |
27 from devil.utils import reraiser_thread | 28 from devil.utils import reraiser_thread |
28 from devil.utils import run_tests_helper | 29 from devil.utils import run_tests_helper |
29 | 30 |
30 from pylib import constants | 31 from pylib import constants |
31 from pylib import forwarder | 32 from pylib import forwarder |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 constants.SetBuildType(args.build_type) | 116 constants.SetBuildType(args.build_type) |
116 if args.build_directory: | 117 if args.build_directory: |
117 constants.SetBuildDirectory(args.build_directory) | 118 constants.SetBuildDirectory(args.build_directory) |
118 if args.output_directory: | 119 if args.output_directory: |
119 constants.SetOutputDirectory(args.output_directory) | 120 constants.SetOutputDirectory(args.output_directory) |
120 | 121 |
121 devil_custom_deps = None | 122 devil_custom_deps = None |
122 if args.adb_path: | 123 if args.adb_path: |
123 devil_custom_deps = { | 124 devil_custom_deps = { |
124 'adb': { | 125 'adb': { |
125 'android_host': [args.adb_path] | 126 devil_env.GetPlatform(): [args.adb_path] |
126 } | 127 } |
127 } | 128 } |
128 | 129 |
129 devil_chromium.Initialize( | 130 devil_chromium.Initialize( |
130 output_directory=constants.GetOutDirectory(), | 131 output_directory=constants.GetOutDirectory(), |
131 custom_deps=devil_custom_deps) | 132 custom_deps=devil_custom_deps) |
132 | 133 |
133 # Some things such as Forwarder require ADB to be in the environment path. | 134 # Some things such as Forwarder require ADB to be in the environment path. |
134 adb_dir = os.path.dirname(constants.GetAdbPath()) | 135 adb_dir = os.path.dirname(constants.GetAdbPath()) |
135 if adb_dir and adb_dir not in os.environ['PATH'].split(os.pathsep): | 136 if adb_dir and adb_dir not in os.environ['PATH'].split(os.pathsep): |
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1039 if e.is_infra_error: | 1040 if e.is_infra_error: |
1040 return constants.INFRA_EXIT_CODE | 1041 return constants.INFRA_EXIT_CODE |
1041 return constants.ERROR_EXIT_CODE | 1042 return constants.ERROR_EXIT_CODE |
1042 except: # pylint: disable=W0702 | 1043 except: # pylint: disable=W0702 |
1043 logging.exception('Unrecognized error occurred.') | 1044 logging.exception('Unrecognized error occurred.') |
1044 return constants.ERROR_EXIT_CODE | 1045 return constants.ERROR_EXIT_CODE |
1045 | 1046 |
1046 | 1047 |
1047 if __name__ == '__main__': | 1048 if __name__ == '__main__': |
1048 sys.exit(main()) | 1049 sys.exit(main()) |
OLD | NEW |