aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authoryelinhsieh <yelinhsieh@google.com>2018-11-06 11:49:55 +0800
committerYelin Hsieh <yelinhsieh@google.com>2019-01-14 03:30:06 +0000
commit80880a3460a96bd48dce17e3bfa5aec69faf732d (patch)
tree64ea06054bf082f478c0961fd8a15ec9ecdaf58b /python
parent98975c301e6be189e505c4c16b0fbde94f577f76 (diff)
downloadbuild_soong-80880a3460a96bd48dce17e3bfa5aec69faf732d.tar.gz
build_soong-80880a3460a96bd48dce17e3bfa5aec69faf732d.tar.bz2
build_soong-80880a3460a96bd48dce17e3bfa5aec69faf732d.zip
Autogen python test config.
Feature request from developer, autogen python test config. Bug:118442443 Test: $source build/envsetup.sh ; lunch $sed -i '/test_config/d' tools/acloud/Android.bp $make acloud_test $[ -f $ANDROID_HOST_OUT_TESTCASES/acloud_test/acloud_test.config ] && echo "Found" || echo "Not found" Change-Id: I196230581b456afe03e67f9cd84c028d18ba08d9
Diffstat (limited to 'python')
-rw-r--r--python/androidmk.go5
-rw-r--r--python/test.go10
2 files changed, 15 insertions, 0 deletions
diff --git a/python/androidmk.go b/python/androidmk.go
index 20861cb8..c1eaa5eb 100644
--- a/python/androidmk.go
+++ b/python/androidmk.go
@@ -70,6 +70,11 @@ func (p *testDecorator) AndroidMk(base *Module, ret *android.AndroidMkData) {
if p.testProperties.Test_config != nil {
fmt.Fprintln(w, "LOCAL_TEST_CONFIG :=",
*p.testProperties.Test_config)
+ } else {
+ if p.testConfig != nil {
+ fmt.Fprintln(w, "LOCAL_FULL_TEST_CONFIG :=",
+ p.testConfig.String())
+ }
}
})
base.subAndroidMk(ret, p.binaryDecorator.pythonInstaller)
diff --git a/python/test.go b/python/test.go
index 39326f06..43ee54c8 100644
--- a/python/test.go
+++ b/python/test.go
@@ -16,6 +16,7 @@ package python
import (
"android/soong/android"
+ "android/soong/tradefed"
)
// This file contains the module types for building Python test.
@@ -29,12 +30,18 @@ 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"`
+
+ // the name of the test configuration template (for example "AndroidTestTemplate.xml") that
+ // should be installed with the module.
+ Test_config_template *string `android:"arch_variant"`
}
type testDecorator struct {
*binaryDecorator
testProperties TestProperties
+
+ testConfig android.Path
}
func (test *testDecorator) bootstrapperProps() []interface{} {
@@ -42,6 +49,9 @@ func (test *testDecorator) bootstrapperProps() []interface{} {
}
func (test *testDecorator) install(ctx android.ModuleContext, file android.Path) {
+ test.testConfig = tradefed.AutoGenPythonBinaryHostTestConfig(ctx, test.testProperties.Test_config,
+ test.testProperties.Test_config_template)
+
test.binaryDecorator.pythonInstaller.dir = "nativetest"
test.binaryDecorator.pythonInstaller.dir64 = "nativetest64"