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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 'test_modules': [ | 198 'test_modules': [ |
199 'java_cpp_enum_tests', | 199 'java_cpp_enum_tests', |
200 ] | 200 ] |
201 }, | 201 }, |
202 } | 202 } |
203 | 203 |
204 LOCAL_MACHINE_TESTS = ['junit', 'python'] | 204 LOCAL_MACHINE_TESTS = ['junit', 'python'] |
205 VALID_ENVIRONMENTS = ['local', 'remote_device'] | 205 VALID_ENVIRONMENTS = ['local', 'remote_device'] |
206 VALID_TEST_TYPES = ['gtest', 'instrumentation', 'junit', 'linker', 'monkey', | 206 VALID_TEST_TYPES = ['gtest', 'instrumentation', 'junit', 'linker', 'monkey', |
207 'perf', 'python', 'uiautomator', 'uirobot'] | 207 'perf', 'python', 'uiautomator', 'uirobot'] |
| 208 VALID_DEVICE_TYPES = ['Android', 'iOS'] |
208 | 209 |
209 | 210 |
210 def GetBuildType(): | 211 def GetBuildType(): |
211 try: | 212 try: |
212 return os.environ['BUILDTYPE'] | 213 return os.environ['BUILDTYPE'] |
213 except KeyError: | 214 except KeyError: |
214 raise Exception('The BUILDTYPE environment variable has not been set') | 215 raise Exception('The BUILDTYPE environment variable has not been set') |
215 | 216 |
216 | 217 |
217 def SetBuildType(build_type): | 218 def SetBuildType(build_type): |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 with file(os.devnull, 'w') as devnull: | 276 with file(os.devnull, 'w') as devnull: |
276 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) | 277 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) |
277 return 'adb' | 278 return 'adb' |
278 except OSError: | 279 except OSError: |
279 logging.debug('No adb found in $PATH, fallback to checked in binary.') | 280 logging.debug('No adb found in $PATH, fallback to checked in binary.') |
280 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') | 281 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') |
281 | 282 |
282 # Exit codes | 283 # Exit codes |
283 ERROR_EXIT_CODE = 1 | 284 ERROR_EXIT_CODE = 1 |
284 WARNING_EXIT_CODE = 88 | 285 WARNING_EXIT_CODE = 88 |
OLD | NEW |