Merge "Fix using generated test configs for sh_test, python_test and rust_test modules"

This commit is contained in:
Treehugger Robot
2020-06-11 08:11:16 +00:00
committed by Gerrit Code Review
4 changed files with 10 additions and 20 deletions

View File

@@ -66,15 +66,9 @@ func (p *testDecorator) AndroidMk(base *Module, ret *android.AndroidMkData) {
fmt.Fprintln(w, "LOCAL_COMPATIBILITY_SUITE :=", fmt.Fprintln(w, "LOCAL_COMPATIBILITY_SUITE :=",
strings.Join(p.binaryDecorator.binaryProperties.Test_suites, " ")) strings.Join(p.binaryDecorator.binaryProperties.Test_suites, " "))
} }
// If the test config has an explicit config specified use it. if p.testConfig != nil {
if p.testProperties.Test_config != nil { fmt.Fprintln(w, "LOCAL_FULL_TEST_CONFIG :=",
fmt.Fprintln(w, "LOCAL_TEST_CONFIG :=", p.testConfig.String())
*p.testProperties.Test_config)
} else {
if p.testConfig != nil {
fmt.Fprintln(w, "LOCAL_FULL_TEST_CONFIG :=",
p.testConfig.String())
}
} }
if !BoolDefault(p.binaryProperties.Auto_gen_config, true) { if !BoolDefault(p.binaryProperties.Auto_gen_config, true) {

View File

@@ -29,11 +29,11 @@ func init() {
type TestProperties struct { type TestProperties struct {
// the name of the test configuration (for example "AndroidTest.xml") that should be // the name of the test configuration (for example "AndroidTest.xml") that should be
// installed with the module. // installed with the module.
Test_config *string `android:"arch_variant"` Test_config *string `android:"path,arch_variant"`
// the name of the test configuration template (for example "AndroidTestTemplate.xml") that // the name of the test configuration template (for example "AndroidTestTemplate.xml") that
// should be installed with the module. // should be installed with the module.
Test_config_template *string `android:"arch_variant"` Test_config_template *string `android:"path,arch_variant"`
} }
type testDecorator struct { type testDecorator struct {

View File

@@ -25,11 +25,11 @@ import (
type TestProperties struct { type TestProperties struct {
// the name of the test configuration (for example "AndroidTest.xml") that should be // the name of the test configuration (for example "AndroidTest.xml") that should be
// installed with the module. // installed with the module.
Test_config *string `android:"arch_variant"` Test_config *string `android:"path,arch_variant"`
// the name of the test configuration template (for example "AndroidTestTemplate.xml") that // the name of the test configuration template (for example "AndroidTestTemplate.xml") that
// should be installed with the module. // should be installed with the module.
Test_config_template *string `android:"arch_variant"` Test_config_template *string `android:"path,arch_variant"`
// list of compatibility suites (for example "cts", "vts") that the module should be // list of compatibility suites (for example "cts", "vts") that the module should be
// installed into. // installed into.

View File

@@ -70,7 +70,7 @@ type TestProperties struct {
// the name of the test configuration (for example "AndroidTest.xml") that should be // the name of the test configuration (for example "AndroidTest.xml") that should be
// installed with the module. // installed with the module.
Test_config *string `android:"arch_variant"` Test_config *string `android:"path,arch_variant"`
// list of files or filegroup modules that provide data that should be installed alongside // list of files or filegroup modules that provide data that should be installed alongside
// the test. // the test.
@@ -231,12 +231,8 @@ func (s *ShTest) AndroidMkEntries() []android.AndroidMkEntries {
s.customAndroidMkEntries(entries) s.customAndroidMkEntries(entries)
entries.AddStrings("LOCAL_COMPATIBILITY_SUITE", s.testProperties.Test_suites...) entries.AddStrings("LOCAL_COMPATIBILITY_SUITE", s.testProperties.Test_suites...)
if s.testProperties.Test_config != nil { if s.testConfig != nil {
entries.SetString("LOCAL_TEST_CONFIG", proptools.String(s.testProperties.Test_config)) entries.SetPath("LOCAL_FULL_TEST_CONFIG", s.testConfig)
} else {
if s.testConfig != nil {
entries.SetString("LOCAL_FULL_TEST_CONFIG", s.testConfig.String())
}
} }
for _, d := range s.data { for _, d := range s.data {
rel := d.Rel() rel := d.Rel()