summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2025-03-04 11:34:55 -0800
committer Cole Faust <colefaust@google.com> 2025-03-04 11:34:55 -0800
commit156085b945de668069e1a35de3a2d3cb4b31618d (patch)
treec2c6f44e6104c73a2297d30e238ffc023df304a1
parentde3a5c4be8aff15998cbf898e06fcc4679fe911f (diff)
Build test_module_config modules' module_info_json in soong
To be able to run these tests in soong-only builds. This cl produces the following diff: https://paste.googleplex.com/4917659043627008 The diff is enitrely additional host dependencies. Without the line adding the ExtraHostRequired modules it becomes a diff of missing host dependencies. Of the two I chose the extras. It's difficult to get the required list exactly matching make. Fixes: 400731860 Test: The diff + atest CtsWifiTestCases_NoNonMainlineTest Change-Id: Idbbfbf7f74eb2eeaf68d64c0bcfbc97ddae3e2ea
-rw-r--r--android/module.go1
-rw-r--r--android/module_info_json.go10
-rw-r--r--tradefed_modules/test_module_config.go16
3 files changed, 23 insertions, 4 deletions
diff --git a/android/module.go b/android/module.go
index 7786f13ee..713751a71 100644
--- a/android/module.go
+++ b/android/module.go
@@ -2167,6 +2167,7 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext)
} else {
hostRequired = m.baseProperties.Host_required
}
+ hostRequired = append(hostRequired, moduleInfoJSON.ExtraHostRequired...)
var data []string
for _, d := range ctx.testData {
diff --git a/android/module_info_json.go b/android/module_info_json.go
index bb309ffee..50c961abe 100644
--- a/android/module_info_json.go
+++ b/android/module_info_json.go
@@ -40,10 +40,12 @@ type ExtraModuleInfoJSON struct {
StaticDependencies []string `json:"static_dependencies,omitempty"` // $(sort $(ALL_MODULES.$(m).LOCAL_STATIC_LIBRARIES))
DataDependencies []string `json:"data_dependencies,omitempty"` // $(sort $(ALL_MODULES.$(m).TEST_DATA_BINS))
- CompatibilitySuites []string `json:"compatibility_suites,omitempty"` // $(sort $(ALL_MODULES.$(m).COMPATIBILITY_SUITES))
- AutoTestConfig []string `json:"auto_test_config,omitempty"` // $(ALL_MODULES.$(m).auto_test_config)
- TestConfig []string `json:"test_config,omitempty"` // $(strip $(ALL_MODULES.$(m).TEST_CONFIG) $(ALL_MODULES.$(m).EXTRA_TEST_CONFIGS)
- ExtraRequired []string `json:"-"`
+ CompatibilitySuites []string `json:"compatibility_suites,omitempty"` // $(sort $(ALL_MODULES.$(m).COMPATIBILITY_SUITES))
+ AutoTestConfig []string `json:"auto_test_config,omitempty"` // $(ALL_MODULES.$(m).auto_test_config)
+ TestConfig []string `json:"test_config,omitempty"` // $(strip $(ALL_MODULES.$(m).TEST_CONFIG) $(ALL_MODULES.$(m).EXTRA_TEST_CONFIGS)
+ TestModuleConfigBase string `json:"test_module_config_base,omitempty"`
+ ExtraRequired []string `json:"-"`
+ ExtraHostRequired []string `json:"-"`
SupportedVariantsOverride []string `json:"-"`
Disabled bool `json:"-"`
diff --git a/tradefed_modules/test_module_config.go b/tradefed_modules/test_module_config.go
index 988352cd2..6dd48eb5a 100644
--- a/tradefed_modules/test_module_config.go
+++ b/tradefed_modules/test_module_config.go
@@ -162,6 +162,22 @@ func (m *testModuleConfigModule) GenerateAndroidBuildActions(ctx android.ModuleC
m.validateBase(ctx, &testModuleConfigTag, "android_test", false)
m.generateManifestAndConfig(ctx)
+ moduleInfoJSON := ctx.ModuleInfoJSON()
+ moduleInfoJSON.Class = []string{m.provider.MkAppClass}
+ if m.provider.MkAppClass != "NATIVE_TESTS" {
+ moduleInfoJSON.Tags = append(moduleInfoJSON.Tags, "tests")
+ }
+ if m.provider.IsUnitTest {
+ moduleInfoJSON.IsUnitTest = "true"
+ }
+ moduleInfoJSON.CompatibilitySuites = append(moduleInfoJSON.CompatibilitySuites, m.tradefedProperties.Test_suites...)
+ moduleInfoJSON.SystemSharedLibs = []string{"none"}
+ moduleInfoJSON.ExtraRequired = append(moduleInfoJSON.ExtraRequired, m.provider.RequiredModuleNames...)
+ moduleInfoJSON.ExtraRequired = append(moduleInfoJSON.ExtraRequired, *m.Base)
+ moduleInfoJSON.ExtraHostRequired = append(moduleInfoJSON.ExtraRequired, m.provider.HostRequiredModuleNames...)
+ moduleInfoJSON.TestConfig = []string{m.testConfig.String()}
+ moduleInfoJSON.AutoTestConfig = []string{"true"}
+ moduleInfoJSON.TestModuleConfigBase = proptools.String(m.Base)
}
// Ensure at least one test_suite is listed. Ideally it should be general-tests