aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorNan Zhang <nanzhang@google.com>2017-11-03 16:54:05 -0700
committerNan Zhang <nanzhang@google.com>2017-11-07 13:13:59 -0800
commitc9c6cb77d8af6034675ad4d80b0da54273156220 (patch)
tree88476cc7e782ebd9dc25dd926baa6d5e0af1af39 /python
parent4647be4afe1dd6d0c4ce2da9e053f27d770216dd (diff)
downloadbuild_soong-c9c6cb77d8af6034675ad4d80b0da54273156220.tar.gz
build_soong-c9c6cb77d8af6034675ad4d80b0da54273156220.tar.bz2
build_soong-c9c6cb77d8af6034675ad4d80b0da54273156220.zip
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
Diffstat (limited to 'python')
-rw-r--r--python/androidmk.go14
-rw-r--r--python/binary.go4
2 files changed, 18 insertions, 0 deletions
diff --git a/python/androidmk.go b/python/androidmk.go
index 25abdc91..4c944508 100644
--- a/python/androidmk.go
+++ b/python/androidmk.go
@@ -48,11 +48,25 @@ func (p *Module) AndroidMk() android.AndroidMkData {
func (p *binaryDecorator) AndroidMk(base *Module, ret *android.AndroidMkData) {
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)
}
func (p *testDecorator) AndroidMk(base *Module, ret *android.AndroidMkData) {
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)
}
diff --git a/python/binary.go b/python/binary.go
index c2e38bf3..95b0606e 100644
--- a/python/binary.go
+++ b/python/binary.go
@@ -40,6 +40,10 @@ type BinaryProperties struct {
// append to the name of the output binary.
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 {