summaryrefslogtreecommitdiff
path: root/tradefed
diff options
context:
space:
mode:
author Dan Shi <dshi@google.com> 2024-09-26 17:47:16 +0000
committer Dan Shi <dshi@google.com> 2024-09-26 17:47:16 +0000
commit4b34a7296f43cd3e0e8c7a22bc7d448d519606dd (patch)
tree75f6fd5c6ddbf8cf55a7b54497dd69bfa661aa16 /tradefed
parentad95b9b84ad2476f1123a0bf5ad710aebb2a2b92 (diff)
Support test_runner_options in android_test
Bug: 369606588 Test: m HelloActivityTests Change-Id: I5fa8537ba2680c0f1f3550d5f3c6874fdbb7c46f
Diffstat (limited to 'tradefed')
-rw-r--r--tradefed/autogen.go23
1 files changed, 17 insertions, 6 deletions
diff --git a/tradefed/autogen.go b/tradefed/autogen.go
index ddd0a800c..e23079591 100644
--- a/tradefed/autogen.go
+++ b/tradefed/autogen.go
@@ -196,16 +196,16 @@ func AutoGenTestConfig(ctx android.ModuleContext, options AutoGenTestConfigOptio
}
var autogenInstrumentationTest = pctx.StaticRule("autogenInstrumentationTest", blueprint.RuleParams{
- Command: "${AutoGenTestConfigScript} $out $in ${EmptyTestConfig} $template ${extraConfigs}",
+ Command: "${AutoGenTestConfigScript} $out $in ${EmptyTestConfig} $template ${extraConfigs} ${extraTestRunnerConfigs}",
CommandDeps: []string{
"${AutoGenTestConfigScript}",
"${EmptyTestConfig}",
"$template",
},
-}, "name", "template", "extraConfigs")
+}, "name", "template", "extraConfigs", "extraTestRunnerConfigs")
func AutoGenInstrumentationTestConfig(ctx android.ModuleContext, testConfigProp *string,
- testConfigTemplateProp *string, manifest android.Path, testSuites []string, autoGenConfig *bool, configs []Config) android.Path {
+ testConfigTemplateProp *string, manifest android.Path, testSuites []string, autoGenConfig *bool, configs []Config, testRunnerConfigs []Option) android.Path {
path, autogenPath := testConfigPath(ctx, testConfigProp, testSuites, autoGenConfig, testConfigTemplateProp)
var configStrings []string
if autogenPath != nil {
@@ -220,15 +220,26 @@ func AutoGenInstrumentationTestConfig(ctx android.ModuleContext, testConfigProp
extraConfigs := strings.Join(configStrings, fmt.Sprintf("\\n%s", test_xml_indent))
extraConfigs = fmt.Sprintf("--extra-configs '%s'", extraConfigs)
+ var testRunnerConfigStrings []string
+ for _, config := range testRunnerConfigs {
+ testRunnerConfigStrings = append(testRunnerConfigStrings, config.Config())
+ }
+ extraTestRunnerConfigs := strings.Join(testRunnerConfigStrings, fmt.Sprintf("\\n%s%s", test_xml_indent, test_xml_indent))
+ if len(extraTestRunnerConfigs) > 0 {
+ extraTestRunnerConfigs += fmt.Sprintf("\\n%s%s", test_xml_indent, test_xml_indent)
+ }
+ extraTestRunnerConfigs = fmt.Sprintf("--extra-test-runner-configs '%s'", extraTestRunnerConfigs)
+
ctx.Build(pctx, android.BuildParams{
Rule: autogenInstrumentationTest,
Description: "test config",
Input: manifest,
Output: autogenPath,
Args: map[string]string{
- "name": ctx.ModuleName(),
- "template": template,
- "extraConfigs": extraConfigs,
+ "name": ctx.ModuleName(),
+ "template": template,
+ "extraConfigs": extraConfigs,
+ "extraTestRunnerConfigs": extraTestRunnerConfigs,
},
})
return autogenPath