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

Unified Diff: build/android/gyp/create_test_runner_script.py

Issue 2819983002: (Reland) Expose resources in Robolectric/JUnit tests. (Closed)
Patch Set: Fix Created 3 years, 8 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
Index: build/android/gyp/create_test_runner_script.py
diff --git a/build/android/gyp/create_test_runner_script.py b/build/android/gyp/create_test_runner_script.py
index b2d08b8537b07487b3e1b6294359df05e1e3be63..69c821f4e80157375c03eba6e6c0aa2787e2ed61 100755
--- a/build/android/gyp/create_test_runner_script.py
+++ b/build/android/gyp/create_test_runner_script.py
@@ -60,6 +60,7 @@ def main(args):
"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.')
@@ -78,6 +79,9 @@ def main(args):
group.add_argument('--test-jar')
group.add_argument('--test-apk-incremental-install-script')
group.add_argument('--coverage-dir')
+ group.add_argument('--android-manifest-path')
+ group.add_argument('--resource-zips')
+ group.add_argument('--robolectric-runtime-deps-dir')
args, test_runner_args = parser.parse_known_args(
build_utils.ExpandFileArgs(args))
@@ -136,6 +140,18 @@ def main(args):
if args.coverage_dir:
test_runner_path_args.append(
('--coverage-dir', RelativizePathToScript(args.coverage_dir)))
+ if args.android_manifest_path:
+ test_runner_path_args.append(
+ ('--android-manifest-path',
+ RelativizePathToScript(args.android_manifest_path)))
+ if args.resource_zips:
+ test_runner_path_args.extend(
+ ('--resource-zip', RelativizePathToScript(r))
+ for r in build_utils.ParseGnList(args.resource_zips))
+ if args.robolectric_runtime_deps_dir:
+ test_runner_path_args.append(
+ ('--robolectric-runtime-deps-dir',
+ RelativizePathToScript(args.robolectric_runtime_deps_dir)))
with open(args.script_output_path, 'w') as script:
script.write(SCRIPT_TEMPLATE.format(

Powered by Google App Engine
This is Rietveld 408576698