Chromium Code Reviews| Index: build/android/test_runner.py |
| diff --git a/build/android/test_runner.py b/build/android/test_runner.py |
| index 6c384b1c6a0be82ff5deedfd931d17a6df12369c..00a874888a6edbd4e7d6252cd61ed06474c182d6 100755 |
| --- a/build/android/test_runner.py |
| +++ b/build/android/test_runner.py |
| @@ -8,14 +8,17 @@ |
| import argparse |
| import collections |
| +import json |
| import logging |
| import os |
| import signal |
| import sys |
| import threading |
| +import tempfile |
| 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 |
| @@ -53,6 +56,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|.""" |
| @@ -117,6 +124,26 @@ def ProcessCommonOptions(args): |
| constants.SetOutputDirectory(args.output_directory) |
| if args.adb_path: |
| constants.SetAdbPath(args.adb_path) |
| + |
| + output_binary = lambda p: os.path.join(args.output_directory, 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 |
| + |
| + with tempfile.NamedTemporaryFile() as devil_dynamic_config_file: |
|
perezju
2015/09/14 09:13:58
Could we hide this tempfile thing in devil_env?
jbudorick
2015/09/14 13:12:39
I need to talk to Kari about doing dynamic config
|
| + devil_dynamic_config_file.write( |
| + json.dumps(devil_env.GenerateDynamicConfig(devil_dynamic_deps))) |
| + devil_dynamic_config_file.flush() |
| + devil_env.Initialize([ |
| + _DEVIL_STATIC_CONFIG_FILE, |
| + devil_dynamic_config_file.name |
| + ]) |
| + |
| # 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): |