Merge "Add extra_test_configs option"

This commit is contained in:
Treehugger Robot
2020-08-21 16:22:43 +00:00
committed by Gerrit Code Review
5 changed files with 45 additions and 7 deletions

View File

@@ -167,6 +167,14 @@ func AndroidMkDataPaths(data []android.DataPath) []string {
return testFiles
}
func androidMkWriteExtraTestConfigs(extraTestConfigs android.Paths, entries *android.AndroidMkEntries) {
if len(extraTestConfigs) > 0 {
entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) {
entries.AddStrings("LOCAL_EXTRA_FULL_TEST_CONFIGS", extraTestConfigs.Strings()...)
})
}
}
func androidMkWriteTestData(data []android.DataPath, ctx AndroidMkContext, entries *android.AndroidMkEntries) {
testFiles := AndroidMkDataPaths(data)
if len(testFiles) > 0 {
@@ -372,6 +380,7 @@ func (test *testBinary) AndroidMkEntries(ctx AndroidMkContext, entries *android.
})
androidMkWriteTestData(test.data, ctx, entries)
androidMkWriteExtraTestConfigs(test.extraTestConfigs, entries)
}
func (fuzz *fuzzBinary) AndroidMkEntries(ctx AndroidMkContext, entries *android.AndroidMkEntries) {

View File

@@ -40,8 +40,12 @@ type TestProperties struct {
type TestOptions struct {
// The UID that you want to run the test as on a device.
Run_test_as *string
// A list of free-formed strings without spaces that categorize the test.
Test_suite_tag []string
// a list of extra test configuration files that should be installed with the module.
Extra_test_configs []string `android:"path,arch_variant"`
}
type TestBinaryProperties struct {
@@ -309,9 +313,10 @@ type testBinary struct {
testDecorator
*binaryDecorator
*baseCompiler
Properties TestBinaryProperties
data []android.DataPath
testConfig android.Path
Properties TestBinaryProperties
data []android.DataPath
testConfig android.Path
extraTestConfigs android.Paths
}
func (test *testBinary) linkerProps() []interface{} {
@@ -408,6 +413,8 @@ func (test *testBinary) install(ctx ModuleContext, file android.Path) {
test.testConfig = tradefed.AutoGenNativeTestConfig(ctx, test.Properties.Test_config,
test.Properties.Test_config_template, test.Properties.Test_suites, configs, test.Properties.Auto_gen_config)
test.extraTestConfigs = android.PathsForModuleSrc(ctx, test.Properties.Test_options.Extra_test_configs)
test.binaryDecorator.baseInstaller.dir = "nativetest"
test.binaryDecorator.baseInstaller.dir64 = "nativetest64"