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

Unified Diff: build/android/test_runner.py

Issue 711113002: Add option to specify ADB binary in test runner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Decided to move where ADB added to path to test_runner.py Created 6 years, 1 month 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
Index: build/android/test_runner.py
diff --git a/build/android/test_runner.py b/build/android/test_runner.py
index 2e39c3c3e31f44d42cf6985ae05de614a0ee3115..cf5b37e5c8513c052d0f8b7e2b9c0e3ac279b624 100755
--- a/build/android/test_runner.py
+++ b/build/android/test_runner.py
@@ -86,6 +86,9 @@ def AddCommonOptions(option_parser):
group.add_option('-e', '--environment', default='local',
help=('Test environment to run in. Must be one of: %s' %
', '.join(constants.VALID_ENVIRONMENTS)))
+ group.add_option('--adb-path',
+ help=('Specify the absolute path of the adb binary that '
+ 'should be used.'))
option_parser.add_option_group(group)
@@ -95,6 +98,12 @@ def ProcessCommonOptions(options, error_func):
constants.SetBuildType(options.build_type)
if options.build_directory:
constants.SetBuildDirectory(options.build_directory)
+ if options.adb_path:
+ constants.SetAdbPath(options.adb_path)
+ # Some things such as Forwarder require ADB to be in the environment path.
jbudorick 2014/11/11 15:27:23 Where is this?
mikecase (-- gone --) 2014/11/11 17:56:41 Forwarder is used inside of base_test_runner.py (c
jbudorick 2014/11/11 18:04:03 I suppose I should have been specific. Where does
mikecase (-- gone --) 2014/11/11 19:36:01 Inside pylib/forwarder.py, inside Map() function,
+ adb_dir = os.path.dirname(constants.GetAdbPath())
+ if adb_dir and adb_dir not in os.environ['PATH'].split(os.pathsep):
jbudorick 2014/11/11 15:27:23 Also, what's up with this...?
mikecase (-- gone --) 2014/11/11 17:56:41 Not sure what you mean. Most of this is logic copi
jbudorick 2014/11/11 18:04:03 This was previously inside android_commands.py bec
mikecase (-- gone --) 2014/11/11 19:36:01 adb_interface.py no longer needs ADB to be in the
+ os.environ['PATH'] = adb_dir + os.pathsep + os.environ['PATH']
if options.environment not in constants.VALID_ENVIRONMENTS:
error_func('--environment must be one of: %s' %
', '.join(constants.VALID_ENVIRONMENTS))

Powered by Google App Engine
This is Rietveld 408576698