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 | 6 |
7 # TODO(jbudorick): Split these constants into coherent modules. | 7 # TODO(jbudorick): Split these constants into coherent modules. |
8 | 8 |
9 # pylint: disable=W0212 | 9 # pylint: disable=W0212 |
10 | 10 |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 | 233 |
234 | 234 |
235 def SetBuildType(build_type): | 235 def SetBuildType(build_type): |
236 os.environ['BUILDTYPE'] = build_type | 236 os.environ['BUILDTYPE'] = build_type |
237 | 237 |
238 | 238 |
239 def SetBuildDirectory(build_directory): | 239 def SetBuildDirectory(build_directory): |
240 os.environ['CHROMIUM_OUT_DIR'] = build_directory | 240 os.environ['CHROMIUM_OUT_DIR'] = build_directory |
241 | 241 |
242 | 242 |
243 def SetOutputDirectort(output_directory): | 243 def SetOutputDirectory(output_directory): |
244 os.environ['CHROMIUM_OUTPUT_DIR'] = output_directory | 244 os.environ['CHROMIUM_OUTPUT_DIR'] = output_directory |
245 | 245 |
246 | 246 |
247 def GetOutDirectory(build_type=None): | 247 def GetOutDirectory(build_type=None): |
248 """Returns the out directory where the output binaries are built. | 248 """Returns the out directory where the output binaries are built. |
249 | 249 |
250 Args: | 250 Args: |
251 build_type: Build type, generally 'Debug' or 'Release'. Defaults to the | 251 build_type: Build type, generally 'Debug' or 'Release'. Defaults to the |
252 globally set build type environment variable BUILDTYPE. | 252 globally set build type environment variable BUILDTYPE. |
253 """ | 253 """ |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) | 294 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) |
295 return 'adb' | 295 return 'adb' |
296 except OSError: | 296 except OSError: |
297 logging.debug('No adb found in $PATH, fallback to checked in binary.') | 297 logging.debug('No adb found in $PATH, fallback to checked in binary.') |
298 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') | 298 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') |
299 | 299 |
300 # Exit codes | 300 # Exit codes |
301 ERROR_EXIT_CODE = 1 | 301 ERROR_EXIT_CODE = 1 |
302 INFRA_EXIT_CODE = 87 | 302 INFRA_EXIT_CODE = 87 |
303 WARNING_EXIT_CODE = 88 | 303 WARNING_EXIT_CODE = 88 |
OLD | NEW |