summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2023-01-04 17:30:38 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2023-01-04 17:30:38 +0000
commit94682b23c4e209491abd21b0353948e6614f45dd (patch)
treea052ec3ff230fa1508b83c384fb5fbd8c7c0dddf /java/java_test.go
parentf038e067ee0a591bd31c2f0b2fa3224cf7937094 (diff)
parent216805457cb4567fe73f8d31a79c473d8f3d9e33 (diff)
Merge "Allow adding extra tradefed options in the Android.bp file"
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/java/java_test.go b/java/java_test.go
index dff1fd07f..085f6272a 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -1945,3 +1945,27 @@ func TestJavaApiLibraryJarGeneration(t *testing.T) {
}
}
}
+
+func TestTradefedOptions(t *testing.T) {
+ result := PrepareForTestWithJavaBuildComponents.RunTestWithBp(t, `
+java_test_host {
+ name: "foo",
+ test_options: {
+ tradefed_options: [
+ {
+ name: "exclude-path",
+ value: "org/apache"
+ }
+ ]
+ }
+}
+`)
+
+ buildOS := result.Config.BuildOS.String()
+ args := result.ModuleForTests("foo", buildOS+"_common").
+ Output("out/soong/.intermediates/foo/" + buildOS + "_common/foo.config").Args
+ expected := proptools.NinjaAndShellEscape("<option name=\"exclude-path\" value=\"org/apache\" />")
+ if args["extraConfigs"] != expected {
+ t.Errorf("Expected args[\"extraConfigs\"] to equal %q, was %q", expected, args["extraConfigs"])
+ }
+}