Allow test to specify whether or not to auto-generate test config

Attribute `auto_gen_config` is added to test modules.
Test config will be generated if:
the attribute is not set and AndroidTest.xml doesn't exists
or
the attribute is set to true, whether or not AndroidTest.xml exists.

Test config will NOT be auto-generated if:
the attribute is not set and AndroidTest.xml exists
or
the attribute is set to false, whether or not AndroidTest.xml exists.

Bug: 141684102
Test: build test module with auto_gen_config set to true
Change-Id: I64fb003a83d8c32a967835e5f8d12fe4476043be
This commit is contained in:
Dan Shi
2019-09-26 11:41:36 -07:00
parent 505bcb88ed
commit 6ffaaa830d
6 changed files with 52 additions and 18 deletions

View File

@@ -50,7 +50,8 @@ func (test *testDecorator) bootstrapperProps() []interface{} {
func (test *testDecorator) install(ctx android.ModuleContext, file android.Path) {
test.testConfig = tradefed.AutoGenPythonBinaryHostTestConfig(ctx, test.testProperties.Test_config,
test.testProperties.Test_config_template, test.binaryDecorator.binaryProperties.Test_suites)
test.testProperties.Test_config_template, test.binaryDecorator.binaryProperties.Test_suites,
test.binaryDecorator.binaryProperties.Auto_gen_config)
test.binaryDecorator.pythonInstaller.dir = "nativetest"
test.binaryDecorator.pythonInstaller.dir64 = "nativetest64"