summaryrefslogtreecommitdiff
path: root/rust/test.go
diff options
context:
space:
mode:
Diffstat (limited to 'rust/test.go')
-rw-r--r--rust/test.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/rust/test.go b/rust/test.go
index 4b5296e54..b7ddd06a3 100644
--- a/rust/test.go
+++ b/rust/test.go
@@ -27,7 +27,7 @@ import (
type TestProperties struct {
// Disables the creation of a test-specific directory when used with
// relative_install_path. Useful if several tests need to be in the same
- // directory, but test_per_src doesn't work.
+ // directory.
No_named_install_directory *bool
// the name of the test configuration (for example "AndroidTest.xml") that should be
@@ -116,8 +116,9 @@ func (test *testDecorator) compilerProps() []interface{} {
}
func (test *testDecorator) install(ctx ModuleContext) {
- testInstallBase := "/data/local/tests/unrestricted"
- if ctx.RustModule().InVendor() || ctx.RustModule().UseVndk() {
+ // TODO: (b/167308193) Switch to /data/local/tests/unrestricted as the default install base.
+ testInstallBase := "/data/local/tmp"
+ if ctx.RustModule().InVendorOrProduct() {
testInstallBase = "/data/local/tests/vendor"
}
@@ -189,6 +190,7 @@ func (test *testDecorator) install(ctx ModuleContext) {
if ctx.Host() && test.Properties.Test_options.Unit_test == nil {
test.Properties.Test_options.Unit_test = proptools.BoolPtr(true)
}
+ test.binaryDecorator.installTestData(ctx, test.data)
test.binaryDecorator.install(ctx)
}
@@ -222,11 +224,13 @@ func RustTestFactory() android.Module {
// rustTestHostMultilib load hook to set MultilibFirst for the
// host target.
android.AddLoadHook(module, rustTestHostMultilib)
+ module.testModule = true
return module.Init()
}
func RustTestHostFactory() android.Module {
module, _ := NewRustTest(android.HostSupported)
+ module.testModule = true
return module.Init()
}