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

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

Issue 1674353004: [Android] Fix generated scripts for junit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Alphabetized the gyp includes everywhere. Created 4 years, 10 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/config/android/internal_rules.gni ('k') | build/host_jar.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/android/rules.gni
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni
index 669f64606f0bd8ffdcc47b6d929b00ba3ed00b39..3305b04726c1c135f21cf407adbd49fa98bf7893 100644
--- a/build/config/android/rules.gni
+++ b/build/config/android/rules.gni
@@ -932,17 +932,25 @@ template("java_binary") {
# }
template("junit_binary") {
set_sources_assignment_filter([])
+ testonly = true
+
+ _java_binary_target_name = "${target_name}__java_binary"
+ _test_runner_target_name = "${target_name}__test_runner_script"
+
+ test_runner_script(_test_runner_target_name) {
+ test_name = invoker.target_name
+ test_suite = invoker.target_name
+ test_type = "junit"
+ }
- java_binary(target_name) {
+ java_binary(_java_binary_target_name) {
deps = []
+ jar_name = invoker.target_name
forward_variables_from(invoker, "*")
+ testonly = true
bypass_platform_checks = true
main_class = "org.chromium.testing.local.JunitTestMain"
- wrapper_script_args = [
- "-test-jars",
- "$target_name.jar",
- ]
- testonly = true
+ wrapper_script_name = "$target_name"
deps += [
"//testing/android/junit:junit_test_support",
@@ -952,6 +960,12 @@ template("junit_binary") {
"//third_party/robolectric:robolectric_java",
]
}
+ group(target_name) {
+ public_deps = [
+ ":$_java_binary_target_name",
+ ":$_test_runner_target_name",
+ ]
+ }
}
# Declare a java library target
« no previous file with comments | « build/config/android/internal_rules.gni ('k') | build/host_jar.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698