From 216805457cb4567fe73f8d31a79c473d8f3d9e33 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Wed, 7 Dec 2022 18:18:37 -0800 Subject: Allow adding extra tradefed options in the Android.bp file Some tests need to add custom tradefed options, but still want to keep most of the soong autogenerated tradefed xml file. Expose a test_options: { tradefed_options: [...] } property that will allow tests to add more options to the autogenerated xml file. Fixes: 184895128 Test: go test, and verified that the ninja files did not change for aosp_arm64 Change-Id: I50d4ad139322e9e207202f1e1a50f5bbb424aa6f --- java/java_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'java/java_test.go') 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("