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
This commit is contained in:
Cole Faust
2022-12-07 18:18:37 -08:00
parent 3784d14404
commit 8ec823cba1
10 changed files with 232 additions and 177 deletions

View File

@@ -379,8 +379,16 @@ func (s *ShTest) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
configs = append(configs, tradefed.Object{"target_preparer", "com.android.tradefed.targetprep.PushFilePreparer", options})
}
s.testConfig = tradefed.AutoGenShellTestConfig(ctx, s.testProperties.Test_config,
s.testProperties.Test_config_template, s.testProperties.Test_suites, configs, s.testProperties.Auto_gen_config, s.outputFilePath.Base())
s.testConfig = tradefed.NewMaybeAutoGenTestConfigBuilder(ctx).
SetTestConfigProp(s.testProperties.Test_config).
SetTestTemplateConfigProp(s.testProperties.Test_config_template).
SetTestSuites(s.testProperties.Test_suites).
SetConfig(configs).
SetAutoGenConfig(s.testProperties.Auto_gen_config).
SetOutputFileName(s.outputFilePath.Base()).
SetDeviceTemplate("${ShellTestConfigTemplate}").
SetHostTemplate("${ShellTestConfigTemplate}").
Build()
s.dataModules = make(map[string]android.Path)
ctx.VisitDirectDeps(func(dep android.Module) {