Support test runnner option in auto generated test configs

Bug: 284179405
Bug: 236980335
Test: unittest
Change-Id: Ifae3d556ff79153ca6c3067347fc259b665fb2e1
This commit is contained in:
Dan Shi
2023-05-26 04:21:44 +00:00
parent 1befe407a1
commit ec7314336a
4 changed files with 59 additions and 12 deletions

View File

@@ -2298,3 +2298,27 @@ java_test_host {
t.Errorf("Expected args[\"extraConfigs\"] to equal %q, was %q", expected, args["extraConfigs"])
}
}
func TestTestRunnerOptions(t *testing.T) {
result := PrepareForTestWithJavaBuildComponents.RunTestWithBp(t, `
java_test_host {
name: "foo",
test_options: {
test_runner_options: [
{
name: "test-timeout",
value: "10m"
}
]
}
}
`)
buildOS := result.Config.BuildOS.String()
args := result.ModuleForTests("foo", buildOS+"_common").
Output("out/soong/.intermediates/foo/" + buildOS + "_common/foo.config").Args
expected := proptools.NinjaAndShellEscape("<option name=\"test-timeout\" value=\"10m\" />\\n ")
if args["extraTestRunnerConfigs"] != expected {
t.Errorf("Expected args[\"extraTestRunnerConfigs\"] to equal %q, was %q", expected, args["extraTestRunnerConfigs"])
}
}