Add TestOnlyProvider for test_module_config

This one is trivial as these modules are always tests and
top-level-test-targets and don't have any complicated struct composition

This requires aosp/3045317 for "m all_teams" to work for
test_module_config_host.

Test: go test ./tradefed_modules
Test: m all_teams
Change-Id: I229e7690088e996452784183a852325c3003ee93
This commit is contained in:
Ronald Braunstein
2024-04-18 09:18:29 -07:00
parent 1f0aeb0644
commit d245346df5
2 changed files with 70 additions and 1 deletions

View File

@@ -297,10 +297,16 @@ func (m *testModuleConfigModule) validateBase(ctx android.ModuleContext, depTag
// 1. manifest file to testcases dir
// 2. New Module.config / AndroidTest.xml file with our options.
func (m *testModuleConfigModule) generateManifestAndConfig(ctx android.ModuleContext) {
// Keep before early returns.
android.SetProvider(ctx, android.TestOnlyProviderKey, android.TestModuleInformation{
TestOnly: true,
TopLevelTarget: true,
})
if !m.validateTestSuites(ctx) {
return
}
// Ensure the provider is accurate
// Ensure the base provider is accurate
if m.provider.TestConfig == nil {
return
}