aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorJulien Desprez <jdesprez@google.com>2018-08-02 15:00:46 -0700
committerJulien Desprez <jdesprez@google.com>2018-08-07 15:51:21 -0700
commite146e39fa6852d66f20c6140784086ce23858e84 (patch)
tree02745294183104aeb4a30e4106cdb9503b848eb0 /python
parent6bfe4eb42c79d4930a71ba5ad013177b1741713f (diff)
downloadandroid_build_soong-e146e39fa6852d66f20c6140784086ce23858e84.tar.gz
android_build_soong-e146e39fa6852d66f20c6140784086ce23858e84.tar.bz2
android_build_soong-e146e39fa6852d66f20c6140784086ce23858e84.zip
Support 'test_config' into soong modules
Test: make general-tests Bug: 110982517 Change-Id: Ib2eab2653fdfce6f699b85c9fbc64558b6d40363
Diffstat (limited to 'python')
-rw-r--r--python/androidmk.go5
-rw-r--r--python/test.go12
2 files changed, 17 insertions, 0 deletions
diff --git a/python/androidmk.go b/python/androidmk.go
index 365b422f..20861cb8 100644
--- a/python/androidmk.go
+++ b/python/androidmk.go
@@ -66,6 +66,11 @@ func (p *testDecorator) AndroidMk(base *Module, ret *android.AndroidMkData) {
fmt.Fprintln(w, "LOCAL_COMPATIBILITY_SUITE :=",
strings.Join(p.binaryDecorator.binaryProperties.Test_suites, " "))
}
+ // If the test config has an explicit config specified use it.
+ if p.testProperties.Test_config != nil {
+ fmt.Fprintln(w, "LOCAL_TEST_CONFIG :=",
+ *p.testProperties.Test_config)
+ }
})
base.subAndroidMk(ret, p.binaryDecorator.pythonInstaller)
}
diff --git a/python/test.go b/python/test.go
index 825e63cc..39326f06 100644
--- a/python/test.go
+++ b/python/test.go
@@ -25,8 +25,20 @@ func init() {
android.RegisterModuleType("python_test", PythonTestFactory)
}
+type TestProperties struct {
+ // the name of the test configuration (for example "AndroidTest.xml") that should be
+ // installed with the module.
+ Test_config *string `android:"arch_variant"`
+}
+
type testDecorator struct {
*binaryDecorator
+
+ testProperties TestProperties
+}
+
+func (test *testDecorator) bootstrapperProps() []interface{} {
+ return append(test.binaryDecorator.bootstrapperProps(), &test.testProperties)
}
func (test *testDecorator) install(ctx android.ModuleContext, file android.Path) {