Chromium Code Reviews| Index: chrome/test/chromedriver/run_all_tests.py |
| diff --git a/chrome/test/chromedriver/run_all_tests.py b/chrome/test/chromedriver/run_all_tests.py |
| index e9717c593e4a4e4da36def7cc28417bd8e41dcce..cb32d9e2014d57d14bd82f0755e01a4b7605f902 100755 |
| --- a/chrome/test/chromedriver/run_all_tests.py |
| +++ b/chrome/test/chromedriver/run_all_tests.py |
| @@ -14,6 +14,31 @@ sys.path.insert(0, os.path.join(_THIS_DIR, os.pardir, 'pylib')) |
| from common import chrome_paths |
| from common import util |
| +def _AppendEnvironmentPath(env_name, path): |
| + if env_name in os.environ: |
| + lib_path = os.environ[env_name] |
| + if path not in lib_path: |
| + os.environ[env_name] += os.pathsep + path |
| + else: |
| + os.environ[env_name] = path |
| + |
| +def _FindChromeBinary(path): |
| + if util.IsLinux(): |
| + exes = ['chrome'] |
| + elif util.IsMac(): |
| + exes = [ |
| + 'Google Chrome.app/Contents/MacOS/Google Chrome', |
| + 'Chromium.app/Contents/MacOS/Chromium' |
| + ] |
| + elif util.IsWindows(): |
| + exes = ['chrome.exe'] |
| + else: |
| + exes = [] |
| + for exe in exes: |
| + binary = os.path.join(path, exe) |
| + if os.path.exists(binary): |
| + return binary |
| + return None |
| def Main(): |
| print '@@@BUILD_STEP chromedriver2_tests@@@' |
| @@ -29,6 +54,17 @@ def Main(): |
| os.path.join(_THIS_DIR, 'test.py'), |
| os.path.join(build_dir, chromedriver), |
| ] |
| + # Set the built chrome binary |
|
kkania
2012/12/04 01:30:25
'.' at end of comments
chrisgao (Use stgao instead)
2012/12/04 01:51:34
Done.
|
| + chrome_binary = _FindChromeBinary(build_dir) |
| + if chrome_binary is not None: |
| + cmd.append(chrome_binary) |
| + if util.IsLinux(): |
| + # Set LD_LIBRARY_PATH to enable successful loading of shared object files, |
| + # when chromedriver2.so is not a static build. |
| + _AppendEnvironmentPath('LD_LIBRARY_PATH', os.path.join(build_dir, 'lib')) |
| + elif util.IsMac(): |
| + # In Mac, chromedriver2.so is a 32-bit build, so run with the 32-bit python. |
| + os.environ['VERSIONER_PYTHON_PREFER_32_BIT'] = 'yes' |
| code = util.RunCommand(cmd) |
| if code != 0: |
| print '@@@STEP_FAILURE@@@' |