From 8ec823cba166a41eb0e9e5ff8fe679e691fec678 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: I75f7eb002c8325ce7cdc76e12e76e16195320620 --- java/robolectric.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'java/robolectric.go') diff --git a/java/robolectric.go b/java/robolectric.go index 938abe138..6a2d0b3ac 100644 --- a/java/robolectric.go +++ b/java/robolectric.go @@ -131,9 +131,14 @@ func (r *robolectricTest) GenerateAndroidBuildActions(ctx android.ModuleContext) r.forceOSType = ctx.Config().BuildOS r.forceArchType = ctx.Config().BuildArch - r.testConfig = tradefed.AutoGenRobolectricTestConfig(ctx, r.testProperties.Test_config, - r.testProperties.Test_config_template, r.testProperties.Test_suites, - r.testProperties.Auto_gen_config) + r.testConfig = tradefed.NewMaybeAutoGenTestConfigBuilder(ctx). + SetTestConfigProp(r.testProperties.Test_config). + SetTestTemplateConfigProp(r.testProperties.Test_config_template). + SetTestSuites(r.testProperties.Test_suites). + SetAutoGenConfig(r.testProperties.Auto_gen_config). + SetDeviceTemplate("${RobolectricTestConfigTemplate}"). + SetHostTemplate("${RobolectricTestConfigTemplate}"). + Build() r.data = android.PathsForModuleSrc(ctx, r.testProperties.Data) roboTestConfig := android.PathForModuleGen(ctx, "robolectric"). -- cgit v1.2.3-59-g8ed1b