diff options
author | agrieve <agrieve@chromium.org> | 2016-03-14 12:04:59 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-14 19:06:42 +0000 |
commit | c91b537eb16a73f49e61b08e8d24cfbc4649ed75 (patch) | |
tree | 18519b6b3a88b55c1b9046e676d42c3134b89709 | |
parent | ca29db355bda7920295c4e70cac5c713fbe0d943 (diff) | |
download | chromium_src-c91b537eb16a73f49e61b08e8d24cfbc4649ed75.zip chromium_src-c91b537eb16a73f49e61b08e8d24cfbc4649ed75.tar.gz chromium_src-c91b537eb16a73f49e61b08e8d24cfbc4649ed75.tar.bz2 |
test_runner.py: Auto-detect output dir when running on bots
BUG=594105,593973
Review URL: https://codereview.chromium.org/1799073004
Cr-Commit-Position: refs/heads/master@{#381032}
-rw-r--r-- | build/android/pylib/constants/__init__.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/build/android/pylib/constants/__init__.py b/build/android/pylib/constants/__init__.py index 21001f9..f1844df 100644 --- a/build/android/pylib/constants/__init__.py +++ b/build/android/pylib/constants/__init__.py @@ -9,6 +9,7 @@ # pylint: disable=W0212 import collections +import glob import logging import os import subprocess @@ -260,6 +261,15 @@ def CheckOutputDirectory(): if os.path.exists('build.ninja'): output_dir = os.getcwd() SetOutputDirectory(output_dir) + elif os.environ.get('CHROME_HEADLESS'): + # When running on bots, see if the output directory is obvious. + dirs = glob.glob(os.path.join(DIR_SOURCE_ROOT, 'out', '*', 'build.ninja')) + if len(dirs) == 1: + SetOutputDirectory(dirs[0]) + else: + raise Exception('Neither CHROMIUM_OUTPUT_DIR nor CHROMIUM_OUT_DIR ' + 'has been set. CHROME_HEADLESS detected, but multiple ' + 'out dirs exist: %r' % dirs) else: raise Exception('Neither CHROMIUM_OUTPUT_DIR nor CHROMIUM_OUT_DIR ' 'has been set') |