OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Defines a set of constants shared by test runners and other scripts.""" | 5 """Defines a set of constants shared by test runners and other scripts.""" |
6 # pylint: disable=W0212 | 6 # pylint: disable=W0212 |
7 | 7 |
8 import collections | 8 import collections |
9 import logging | 9 import logging |
10 import os | 10 import os |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 'bad_devices.json') | 180 'bad_devices.json') |
181 | 181 |
182 UPSTREAM_FLAKINESS_SERVER = 'test-results.appspot.com' | 182 UPSTREAM_FLAKINESS_SERVER = 'test-results.appspot.com' |
183 | 183 |
184 DEVICE_LOCAL_PROPERTIES_PATH = '/data/local.prop' | 184 DEVICE_LOCAL_PROPERTIES_PATH = '/data/local.prop' |
185 | 185 |
186 PYTHON_UNIT_TEST_SUITES = { | 186 PYTHON_UNIT_TEST_SUITES = { |
187 'pylib_py_unittests': { | 187 'pylib_py_unittests': { |
188 'path': os.path.join(DIR_SOURCE_ROOT, 'build', 'android'), | 188 'path': os.path.join(DIR_SOURCE_ROOT, 'build', 'android'), |
189 'test_modules': [ | 189 'test_modules': [ |
| 190 'pylib.cmd_helper_test', |
190 'pylib.device.device_utils_test', | 191 'pylib.device.device_utils_test', |
191 'pylib.results.json_results_test', | 192 'pylib.results.json_results_test', |
192 'pylib.utils.md5sum_test', | 193 'pylib.utils.md5sum_test', |
193 ] | 194 ] |
194 }, | 195 }, |
195 'gyp_py_unittests': { | 196 'gyp_py_unittests': { |
196 'path': os.path.join(DIR_SOURCE_ROOT, 'build', 'android', 'gyp'), | 197 'path': os.path.join(DIR_SOURCE_ROOT, 'build', 'android', 'gyp'), |
197 'test_modules': [ | 198 'test_modules': [ |
198 'java_cpp_enum_tests', | 199 'java_cpp_enum_tests', |
199 ] | 200 ] |
200 }, | 201 }, |
201 } | 202 } |
202 | 203 |
203 LOCAL_MACHINE_TESTS = ['junit', 'python'] | 204 LOCAL_MACHINE_TESTS = ['junit', 'python'] |
204 VALID_ENVIRONMENTS = ['local'] | 205 VALID_ENVIRONMENTS = ['local', 'remote_device'] |
205 VALID_TEST_TYPES = ['gtest', 'instrumentation', 'junit', 'linker', 'monkey', | 206 VALID_TEST_TYPES = ['gtest', 'instrumentation', 'junit', 'linker', 'monkey', |
206 'perf', 'python', 'uiautomator'] | 207 'perf', 'python', 'uiautomator', 'uirobot'] |
207 | 208 |
208 | 209 |
209 def GetBuildType(): | 210 def GetBuildType(): |
210 try: | 211 try: |
211 return os.environ['BUILDTYPE'] | 212 return os.environ['BUILDTYPE'] |
212 except KeyError: | 213 except KeyError: |
213 raise Exception('The BUILDTYPE environment variable has not been set') | 214 raise Exception('The BUILDTYPE environment variable has not been set') |
214 | 215 |
215 | 216 |
216 def SetBuildType(build_type): | 217 def SetBuildType(build_type): |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 with file(os.devnull, 'w') as devnull: | 275 with file(os.devnull, 'w') as devnull: |
275 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) | 276 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) |
276 return 'adb' | 277 return 'adb' |
277 except OSError: | 278 except OSError: |
278 logging.debug('No adb found in $PATH, fallback to checked in binary.') | 279 logging.debug('No adb found in $PATH, fallback to checked in binary.') |
279 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') | 280 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') |
280 | 281 |
281 # Exit codes | 282 # Exit codes |
282 ERROR_EXIT_CODE = 1 | 283 ERROR_EXIT_CODE = 1 |
283 WARNING_EXIT_CODE = 88 | 284 WARNING_EXIT_CODE = 88 |
OLD | NEW |