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