summaryrefslogtreecommitdiff
path: root/tradefed
diff options
context:
space:
mode:
author Chih-Hung Hsieh <chh@google.com> 2019-11-22 20:22:35 -0800
committer Chih-hung Hsieh <chh@google.com> 2019-12-02 17:44:53 +0000
commitede57ae8122992e788be7977803926e76e35b466 (patch)
tree69072fa345ac192c934e30db151ff9fcffb406c3 /tradefed
parent01178ed7d15f995e19d441964deee6ba6e1eac7e (diff)
Generate tradefed config for rust device tests.
* The RustBinaryTest runner and device test config template are derived from GTest. Device tests are pushed to /data/local/tmp. Bug: 140938178 Test: make unicode-xid projects; run atest Change-Id: Idb4cab7872b48c6e25bc59b85aa6d9dece4383ec
Diffstat (limited to 'tradefed')
-rw-r--r--tradefed/autogen.go5
-rw-r--r--tradefed/config.go1
-rw-r--r--tradefed/makevars.go1
3 files changed, 6 insertions, 1 deletions
diff --git a/tradefed/autogen.go b/tradefed/autogen.go
index 905acfacb..c35d8b914 100644
--- a/tradefed/autogen.go
+++ b/tradefed/autogen.go
@@ -197,11 +197,14 @@ func AutoGenPythonBinaryHostTestConfig(ctx android.ModuleContext, testConfigProp
return path
}
-func AutoGenRustHostTestConfig(ctx android.ModuleContext, name string, testConfigProp *string,
+func AutoGenRustTestConfig(ctx android.ModuleContext, name string, testConfigProp *string,
testConfigTemplateProp *string, testSuites []string, autoGenConfig *bool) android.Path {
path, autogenPath := testConfigPath(ctx, testConfigProp, testSuites, autoGenConfig)
if autogenPath != nil {
templatePathString := "${RustHostTestConfigTemplate}"
+ if ctx.Device() {
+ templatePathString = "${RustDeviceTestConfigTemplate}"
+ }
templatePath := getTestConfigTemplate(ctx, testConfigTemplateProp)
if templatePath.Valid() {
templatePathString = templatePath.String()
diff --git a/tradefed/config.go b/tradefed/config.go
index 8249ffe81..a289073e4 100644
--- a/tradefed/config.go
+++ b/tradefed/config.go
@@ -31,6 +31,7 @@ func init() {
pctx.SourcePathVariable("NativeHostTestConfigTemplate", "build/make/core/native_host_test_config_template.xml")
pctx.SourcePathVariable("NativeTestConfigTemplate", "build/make/core/native_test_config_template.xml")
pctx.SourcePathVariable("PythonBinaryHostTestConfigTemplate", "build/make/core/python_binary_host_test_config_template.xml")
+ pctx.SourcePathVariable("RustDeviceTestConfigTemplate", "build/make/core/rust_device_test_config_template.xml")
pctx.SourcePathVariable("RustHostTestConfigTemplate", "build/make/core/rust_host_test_config_template.xml")
pctx.SourcePathVariable("EmptyTestConfig", "build/make/core/empty_test_config.xml")
diff --git a/tradefed/makevars.go b/tradefed/makevars.go
index e6b88ea1d..d4cf7a86c 100644
--- a/tradefed/makevars.go
+++ b/tradefed/makevars.go
@@ -31,6 +31,7 @@ func makeVarsProvider(ctx android.MakeVarsContext) {
ctx.Strict("NATIVE_HOST_TEST_CONFIG_TEMPLATE", "${NativeHostTestConfigTemplate}")
ctx.Strict("NATIVE_TEST_CONFIG_TEMPLATE", "${NativeTestConfigTemplate}")
ctx.Strict("PYTHON_BINARY_HOST_TEST_CONFIG_TEMPLATE", "${PythonBinaryHostTestConfigTemplate}")
+ ctx.Strict("RUST_DEVICE_TEST_CONFIG_TEMPLATE", "${RustDeviceTestConfigTemplate}")
ctx.Strict("RUST_HOST_TEST_CONFIG_TEMPLATE", "${RustHostTestConfigTemplate}")
ctx.Strict("EMPTY_TEST_CONFIG", "${EmptyTestConfig}")