From fa8f205cc85634d8fab681cd7fbef2e0aeffaa21 Mon Sep 17 00:00:00 2001 From: agrieve Date: Wed, 6 Apr 2016 15:08:53 -0700 Subject: [PATCH] Allow location of test_runner.py to be overriden in GYP Required for webrtc BUG=599919 Review URL: https://codereview.chromium.org/1868723002 Cr-Original-Commit-Position: refs/heads/master@{#385563} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: a490637d06294d400b0e6496642fc2fbcc974538 --- android/gyp/create_test_runner_script.py | 4 +++- android/test_runner.gypi | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/android/gyp/create_test_runner_script.py b/android/gyp/create_test_runner_script.py index 87d6c6cfb..0b127e7f3 100755 --- a/android/gyp/create_test_runner_script.py +++ b/android/gyp/create_test_runner_script.py @@ -50,6 +50,8 @@ def main(args): parser.add_argument('--depfile', help='Path to the depfile. This must be specified as ' "the action's first output.") + parser.add_argument('--test-runner-path', + help='Path to test_runner.py (optional).') # We need to intercept any test runner path arguments and make all # of the paths relative to the output script directory. group = parser.add_argument_group('Test runner path arguments.') @@ -70,7 +72,7 @@ def main(args): """Returns the path relative to the output script directory.""" return os.path.relpath(path, os.path.dirname(args.script_output_path)) - test_runner_path = os.path.join( + test_runner_path = args.test_runner_path or os.path.join( os.path.dirname(__file__), os.path.pardir, 'test_runner.py') test_runner_path = RelativizePathToScript(test_runner_path) diff --git a/android/test_runner.gypi b/android/test_runner.gypi index b21199596..50e3ffa10 100644 --- a/android/test_runner.gypi +++ b/android/test_runner.gypi @@ -43,6 +43,7 @@ 'variables': { 'additional_apks%': [], 'isolate_file%': '', + 'test_runner_path%': '', }, 'test_runner_args': ['--output-directory', '<(PRODUCT_DIR)'], 'conditions': [ @@ -74,6 +75,9 @@ ['isolate_file != ""', { 'test_runner_args': ['--isolate-file-path', '<(isolate_file)'] }], + ['test_runner_path != ""', { + 'test_runner_args': ['--test-runner-path', '<(test_runner_path)'] + }], ], }, 'actions': [