Merge "Attempt to run all java_test_host that look unit tests"

This commit is contained in:
Julien Desprez 2021-03-04 02:00:58 +00:00 committed by Gerrit Code Review
commit ce45b73070
1 changed files with 6 additions and 0 deletions

View File

@ -2515,6 +2515,11 @@ func (j *TestHost) DepsMutator(ctx android.BottomUpMutatorContext) {
} }
func (j *Test) GenerateAndroidBuildActions(ctx android.ModuleContext) { func (j *Test) GenerateAndroidBuildActions(ctx android.ModuleContext) {
if j.testProperties.Test_options.Unit_test == nil && ctx.Host() {
// TODO(b/): Clean temporary heuristic to avoid unexpected onboarding.
defaultUnitTest := !inList("tradefed", j.properties.Static_libs) && !inList("tradefed", j.properties.Libs) && !inList("cts", j.testProperties.Test_suites) && !inList("robolectric-host-android_all", j.properties.Static_libs) && !inList("robolectric-host-android_all", j.properties.Libs)
j.testProperties.Test_options.Unit_test = proptools.BoolPtr(defaultUnitTest)
}
j.testConfig = tradefed.AutoGenJavaTestConfig(ctx, j.testProperties.Test_config, j.testProperties.Test_config_template, j.testConfig = tradefed.AutoGenJavaTestConfig(ctx, j.testProperties.Test_config, j.testProperties.Test_config_template,
j.testProperties.Test_suites, j.testProperties.Auto_gen_config, j.testProperties.Test_options.Unit_test) j.testProperties.Test_suites, j.testProperties.Auto_gen_config, j.testProperties.Test_options.Unit_test)
@ -2675,6 +2680,7 @@ func TestHostFactory() android.Module {
module.Module.properties.Installable = proptools.BoolPtr(true) module.Module.properties.Installable = proptools.BoolPtr(true)
InitJavaModuleMultiTargets(module, android.HostSupported) InitJavaModuleMultiTargets(module, android.HostSupported)
return module return module
} }