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

Unified Diff: build/config/android/internal_rules.gni

Issue 2864693002: (Reland x3) Expose resources in Robolectric/JUnit tests. (Closed)
Patch Set: Created 3 years, 7 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/test_runner.py ('k') | build/config/android/rules.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/android/internal_rules.gni
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index 218fdfc97771e1fa9f99e7c7623350c9722cc8f7..dccfa5e5ca9958a126acff0d113302f2f1e2304f 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -89,7 +89,7 @@ template("write_build_config") {
type == "android_resources" || type == "deps_dex" ||
type == "dist_jar" || type == "android_assets" ||
type == "resource_rewriter" || type == "java_binary" ||
- type == "group" || type == "java_prebuilt")
+ type == "group" || type == "java_prebuilt" || type == "junit_binary")
forward_variables_from(invoker,
[
@@ -567,11 +567,40 @@ template("test_runner_script") {
}
} else if (_test_type == "junit") {
assert(defined(invoker.test_suite))
+ _device_test = false
test_runner_args += [
"--test-suite",
invoker.test_suite,
]
- _device_test = false
+ if (defined(invoker.android_manifest_path)) {
+ test_runner_args += [
+ "--android-manifest-path",
+ rebase_path(invoker.android_manifest_path, root_build_dir),
+ ]
+ }
+
+ if (defined(invoker.package_name)) {
+ test_runner_args += [
+ "--package-name",
+ invoker.package_name,
+ ]
+
+ deps += [ ":${invoker.test_suite}__build_config" ]
+ _junit_binary_build_config =
+ "${target_gen_dir}/${invoker.test_suite}.build_config"
+ _rebased_build_config =
+ rebase_path("$_junit_binary_build_config", root_build_dir)
+ test_runner_args += [
+ "--resource-zips",
+ "@FileArg($_rebased_build_config:resources:dependency_zips)",
+ ]
+ }
+
+ test_runner_args += [
+ "--robolectric-runtime-deps-dir",
+ rebase_path("$root_build_dir/lib.java/third_party/robolectric",
+ root_build_dir),
+ ]
} else if (_test_type == "linker") {
test_runner_args += [
"--test-apk",
« no previous file with comments | « build/android/test_runner.py ('k') | build/config/android/rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698