diff options
Diffstat (limited to 'tradefed_modules/test_module_config.go')
| -rw-r--r-- | tradefed_modules/test_module_config.go | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/tradefed_modules/test_module_config.go b/tradefed_modules/test_module_config.go index e833df293..c9ef551d6 100644 --- a/tradefed_modules/test_module_config.go +++ b/tradefed_modules/test_module_config.go @@ -179,10 +179,6 @@ func (m *testModuleConfigModule) GenerateAndroidBuildActions(ctx android.ModuleC moduleInfoJSON.TestConfig = []string{m.testConfig.String()} moduleInfoJSON.AutoTestConfig = []string{"true"} moduleInfoJSON.TestModuleConfigBase = proptools.String(m.Base) - - android.SetProvider(ctx, android.SupportFilesInfoProvider, android.SupportFilesInfo{ - SupportFiles: m.supportFiles, - }) } // Ensure at least one test_suite is listed. Ideally it should be general-tests @@ -332,15 +328,21 @@ func (m *testModuleConfigHostModule) DepsMutator(ctx android.BottomUpMutatorCont func (m *testModuleConfigHostModule) GenerateAndroidBuildActions(ctx android.ModuleContext) { m.validateBase(ctx, &testModuleConfigHostTag, "java_test_host", true) m.generateManifestAndConfig(ctx) - android.SetProvider(ctx, android.SupportFilesInfoProvider, android.SupportFilesInfo{ - SupportFiles: m.supportFiles, - }) + + moduleInfoJSON := ctx.ModuleInfoJSON() + moduleInfoJSON.Class = []string{"JAVA_LIBRARIES"} + moduleInfoJSON.Tags = append(moduleInfoJSON.Tags, "tests") + moduleInfoJSON.CompatibilitySuites = append(moduleInfoJSON.CompatibilitySuites, m.tradefedProperties.Test_suites...) + moduleInfoJSON.SystemSharedLibs = []string{"none"} + moduleInfoJSON.TestConfig = []string{m.testConfig.String()} + moduleInfoJSON.AutoTestConfig = []string{"true"} + moduleInfoJSON.TestModuleConfigBase = proptools.String(m.Base) } // Ensure the base listed is the right type by checking that we get the expected provider data. // Returns false on errors and the context is updated with an error indicating the baseType expected. func (m *testModuleConfigModule) validateBase(ctx android.ModuleContext, depTag *dependencyTag, baseType string, baseShouldBeHost bool) { - ctx.VisitDirectDepsWithTag(*depTag, func(dep android.Module) { + ctx.VisitDirectDepsProxyWithTag(*depTag, func(dep android.ModuleProxy) { if provider, ok := android.OtherModuleProvider(ctx, dep, tradefed.BaseTestProviderKey); ok { if baseShouldBeHost == provider.IsHost { m.provider = provider @@ -435,8 +437,19 @@ func (m *testModuleConfigModule) generateManifestAndConfig(ctx android.ModuleCon IsUnitTest: m.provider.IsUnitTest, }) - android.SetProvider(ctx, android.TestSuiteInfoProvider, android.TestSuiteInfo{ - TestSuites: m.tradefedProperties.Test_suites, + mainFileExt := ".apk" + if m.provider.MkAppClass == "JAVA_LIBRARIES" { + mainFileExt = ".jar" + } + + ctx.SetTestSuiteInfo(android.TestSuiteInfo{ + TestSuites: m.tradefedProperties.Test_suites, + MainFile: m.manifest, + MainFileStem: fmt.Sprintf("UNUSED-%s", *m.Base), + MainFileExt: mainFileExt, + ConfigFile: m.testConfig, + CompatibilitySupportFiles: m.supportFiles.Paths(), + NeedsArchFolder: ctx.Device(), }) } |
