Add support for test_suites for python_binary_host and python_test_host

Test: manually add this property, and then check Android-aosp_arm.mk
Bug: b/35394669
Change-Id: Iddaf677839714daf4f8913ff4bf9e944d38c18db
This commit is contained in:
Nan Zhang 2017-11-03 16:54:05 -07:00
parent 4647be4afe
commit c9c6cb77d8
2 changed files with 18 additions and 0 deletions

View File

@ -48,11 +48,25 @@ func (p *Module) AndroidMk() android.AndroidMkData {
func (p *binaryDecorator) AndroidMk(base *Module, ret *android.AndroidMkData) { func (p *binaryDecorator) AndroidMk(base *Module, ret *android.AndroidMkData) {
ret.Class = "EXECUTABLES" ret.Class = "EXECUTABLES"
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) {
if len(p.binaryProperties.Test_suites) > 0 {
fmt.Fprintln(w, "LOCAL_COMPATIBILITY_SUITE :=",
strings.Join(p.binaryProperties.Test_suites, " "))
}
})
base.subAndroidMk(ret, p.baseInstaller) base.subAndroidMk(ret, p.baseInstaller)
} }
func (p *testDecorator) AndroidMk(base *Module, ret *android.AndroidMkData) { func (p *testDecorator) AndroidMk(base *Module, ret *android.AndroidMkData) {
ret.Class = "NATIVE_TESTS" ret.Class = "NATIVE_TESTS"
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) {
if len(p.binaryDecorator.binaryProperties.Test_suites) > 0 {
fmt.Fprintln(w, "LOCAL_COMPATIBILITY_SUITE :=",
strings.Join(p.binaryDecorator.binaryProperties.Test_suites, " "))
}
})
base.subAndroidMk(ret, p.binaryDecorator.baseInstaller) base.subAndroidMk(ret, p.binaryDecorator.baseInstaller)
} }

View File

@ -40,6 +40,10 @@ type BinaryProperties struct {
// append to the name of the output binary. // append to the name of the output binary.
Suffix string `android:"arch_variant"` Suffix string `android:"arch_variant"`
// list of compatibility suites (for example "cts", "vts") that the module should be
// installed into.
Test_suites []string `android:"arch_variant"`
} }
type binaryDecorator struct { type binaryDecorator struct {