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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 }, | 193 }, |
194 'gyp_py_unittests': { | 194 'gyp_py_unittests': { |
195 'path': os.path.join(DIR_SOURCE_ROOT, 'build', 'android', 'gyp'), | 195 'path': os.path.join(DIR_SOURCE_ROOT, 'build', 'android', 'gyp'), |
196 'test_modules': [ | 196 'test_modules': [ |
197 'java_cpp_enum_tests', | 197 'java_cpp_enum_tests', |
198 ] | 198 ] |
199 }, | 199 }, |
200 } | 200 } |
201 | 201 |
202 LOCAL_MACHINE_TESTS = ['junit', 'python'] | 202 LOCAL_MACHINE_TESTS = ['junit', 'python'] |
203 VALID_ENVIRONMENTS = ['local'] | 203 VALID_ENVIRONMENTS = ['local', 'remote_device'] |
204 | 204 |
205 | 205 |
206 def GetBuildType(): | 206 def GetBuildType(): |
207 try: | 207 try: |
208 return os.environ['BUILDTYPE'] | 208 return os.environ['BUILDTYPE'] |
209 except KeyError: | 209 except KeyError: |
210 raise Exception('The BUILDTYPE environment variable has not been set') | 210 raise Exception('The BUILDTYPE environment variable has not been set') |
211 | 211 |
212 | 212 |
213 def SetBuildType(build_type): | 213 def SetBuildType(build_type): |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 with file(os.devnull, 'w') as devnull: | 271 with file(os.devnull, 'w') as devnull: |
272 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) | 272 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) |
273 return 'adb' | 273 return 'adb' |
274 except OSError: | 274 except OSError: |
275 logging.debug('No adb found in $PATH, fallback to checked in binary.') | 275 logging.debug('No adb found in $PATH, fallback to checked in binary.') |
276 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') | 276 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') |
277 | 277 |
278 # Exit codes | 278 # Exit codes |
279 ERROR_EXIT_CODE = 1 | 279 ERROR_EXIT_CODE = 1 |
280 WARNING_EXIT_CODE = 88 | 280 WARNING_EXIT_CODE = 88 |
OLD | NEW |