aboutsummaryrefslogtreecommitdiffstats
path: root/java/app.go
diff options
context:
space:
mode:
authoreasoncylee <easoncylee@google.com>2020-04-30 14:57:06 +0800
committereasoncylee <easoncylee@google.com>2020-05-18 09:59:07 +0800
commitba60625021fc6bf429c00b37dfd79b6082861ab7 (patch)
tree9a6e3c0ac856ea096e10c59fe0ccc29a9a4d1f20 /java/app.go
parent53754e3592e0f3d79cb4184d2689798ddc195172 (diff)
downloadbuild_soong-ba60625021fc6bf429c00b37dfd79b6082861ab7.tar.gz
build_soong-ba60625021fc6bf429c00b37dfd79b6082861ab7.tar.bz2
build_soong-ba60625021fc6bf429c00b37dfd79b6082861ab7.zip
Add test_mainline_modules to the auto-gen test config(AndroidJUnitTest only).
To support parameterized mainline modules in Test Mapping, we plan to add a new parameter called test_mainline_modules in build system to auto-generate the test config based on the parameter. For detailed information: go/test-mapping-mainline-gcl (search for auto-generated pattern) Bug: 155238134 Test: add "test_mainline_modules: [some.apk]" to TetheringTests, and build the modules, confirm the parameterized option is added in the test config. Change-Id: I41ba8749ce46da62db402a8b8a555d4874e1cfc0 Merged-In: I41ba8749ce46da62db402a8b8a555d4874e1cfc0
Diffstat (limited to 'java/app.go')
-rwxr-xr-xjava/app.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/java/app.go b/java/app.go
index 756203c5..611a7d80 100755
--- a/java/app.go
+++ b/java/app.go
@@ -980,6 +980,7 @@ func (a *AndroidTest) InstallInTestcases() bool {
}
func (a *AndroidTest) GenerateAndroidBuildActions(ctx android.ModuleContext) {
+ var configs []tradefed.Config
if a.appTestProperties.Instrumentation_target_package != nil {
a.additionalAaptFlags = append(a.additionalAaptFlags,
"--rename-instrumentation-target-package "+*a.appTestProperties.Instrumentation_target_package)
@@ -992,8 +993,12 @@ func (a *AndroidTest) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
a.generateAndroidBuildActions(ctx)
+ for _, module := range a.testProperties.Test_mainline_modules {
+ configs = append(configs, tradefed.Option{Name: "config-descriptor:metadata", Key: "mainline-param", Value: module})
+ }
+
testConfig := tradefed.AutoGenInstrumentationTestConfig(ctx, a.testProperties.Test_config,
- a.testProperties.Test_config_template, a.manifestPath, a.testProperties.Test_suites, a.testProperties.Auto_gen_config)
+ a.testProperties.Test_config_template, a.manifestPath, a.testProperties.Test_suites, a.testProperties.Auto_gen_config, configs)
a.testConfig = a.FixTestConfig(ctx, testConfig)
a.data = android.PathsForModuleSrc(ctx, a.testProperties.Data)
}