summaryrefslogtreecommitdiff
path: root/java/robolectric.go
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2022-12-07 18:18:37 -0800
committer Cole Faust <colefaust@google.com> 2023-01-03 12:47:11 -0800
commit216805457cb4567fe73f8d31a79c473d8f3d9e33 (patch)
treec0daeda0f00bae651e4126327c531c239bc02f1e /java/robolectric.go
parent2266e02a3a643b138feb6f1ff94d88ec46dfda6d (diff)
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
Diffstat (limited to 'java/robolectric.go')
-rw-r--r--java/robolectric.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/java/robolectric.go b/java/robolectric.go
index 6e8d5913c..68f27b859 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.AutoGenTestConfig(ctx, tradefed.AutoGenTestConfigOptions{
+ TestConfigProp: r.testProperties.Test_config,
+ TestConfigTemplateProp: r.testProperties.Test_config_template,
+ TestSuites: r.testProperties.Test_suites,
+ AutoGenConfig: r.testProperties.Auto_gen_config,
+ DeviceTemplate: "${RobolectricTestConfigTemplate}",
+ HostTemplate: "${RobolectricTestConfigTemplate}",
+ })
r.data = android.PathsForModuleSrc(ctx, r.testProperties.Data)
roboTestConfig := android.PathForModuleGen(ctx, "robolectric").