Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Unified Diff: build/android/test_runner.py

Issue 1316413003: [Android] Add a configurable environment for devil/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/pylintrc ('k') | tools/telemetry/catapult_base/dependency_manager/dependency_manager.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/test_runner.py
diff --git a/build/android/test_runner.py b/build/android/test_runner.py
index 16a2260b2ffec2308f27863fe2cc510ab2051e18..a804e63587be30567801d9a2875f916b144ef311 100755
--- a/build/android/test_runner.py
+++ b/build/android/test_runner.py
@@ -17,6 +17,7 @@ import threading
import unittest
from devil import base_error
+from devil import devil_env
from devil.android import apk_helper
from devil.android import device_blacklist
from devil.android import device_errors
@@ -49,6 +50,10 @@ from pylib.uiautomator import setup as uiautomator_setup
from pylib.uiautomator import test_options as uiautomator_test_options
+_DEVIL_STATIC_CONFIG_FILE = os.path.abspath(os.path.join(
+ constants.DIR_SOURCE_ROOT, 'build', 'android', 'devil_config.json'))
+
+
def AddCommonOptions(parser):
"""Adds all common options to |parser|."""
@@ -113,6 +118,22 @@ def ProcessCommonOptions(args):
constants.SetOutputDirectory(args.output_directory)
if args.adb_path:
constants.SetAdbPath(args.adb_path)
+
+ output_binary = lambda p: os.path.join(constants.GetOutDirectory(), p)
+ devil_dynamic_deps = {
+ 'md5sum_host': [output_binary('md5sum_bin_host')],
+ 'md5sum_device': [output_binary('md5sum_dist')],
+ 'forwarder_host': [output_binary('host_forwarder')],
+ 'forwarder_device': [output_binary('forwarder_dist')],
+ }
+ if args.adb_path:
+ devil_dynamic_deps['adb_path'] = [args.adb_path]
+
+ devil_dynamic_config = devil_env.GenerateDynamicConfig(devil_dynamic_deps)
+ devil_env.config.Initialize(
+ configs=[devil_dynamic_config],
+ config_files=[_DEVIL_STATIC_CONFIG_FILE])
+
# Some things such as Forwarder require ADB to be in the environment path.
adb_dir = os.path.dirname(constants.GetAdbPath())
if adb_dir and adb_dir not in os.environ['PATH'].split(os.pathsep):
« no previous file with comments | « build/android/pylintrc ('k') | tools/telemetry/catapult_base/dependency_manager/dependency_manager.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698