summaryrefslogtreecommitdiff
path: root/rust/test.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2025-02-18 15:18:18 -0800
committer Colin Cross <ccross@android.com> 2025-02-18 15:19:56 -0800
commitb361442aa66c644efba22c6c3da846ac0644d86a (patch)
treedf6345e8800f50ca577044e9fcd7ccde232bf475 /rust/test.go
parent6029aed8b971969c87f42cd940434f0fe1da904b (diff)
Implement host_common_data property for cc, java, rust and sh test modules
Implement the host_common_data property that will copy a host common module into the test data directory. This property can be used to copy a custom Tradefed test runner jar alongside the test. Bug: 262397555 Test: TestHostCommonData Change-Id: Iacef0778254a3dda400c9e221f442c47d8db7b02
Diffstat (limited to 'rust/test.go')
-rw-r--r--rust/test.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/rust/test.go b/rust/test.go
index b658ae252..99f365f4c 100644
--- a/rust/test.go
+++ b/rust/test.go
@@ -46,9 +46,16 @@ type TestProperties struct {
// the test
Data []string `android:"path,arch_variant"`
- // Same as data, but will add dependencies on the device's
+ // Same as data, but adds dependencies on modules using the device's os variant, and common
+ // architecture's variant. Can be useful to add device-built apps to the data of a host
+ // test.
Device_common_data []string `android:"path_device_common"`
+ // Same as data, but will add dependencies on modules using the host's os variation and
+ // the common arch variation. Useful for a device test that wants to depend on a host
+ // module, for example to include a custom Tradefed test runner.
+ Host_common_data []string `android:"path_host_common"`
+
// list of shared library modules that should be installed alongside the test
Data_libs []string `android:"arch_variant"`
@@ -147,6 +154,7 @@ func (test *testDecorator) install(ctx ModuleContext) {
dataSrcPaths := android.PathsForModuleSrc(ctx, test.Properties.Data)
dataSrcPaths = append(dataSrcPaths, android.PathsForModuleSrc(ctx, test.Properties.Device_common_data)...)
+ dataSrcPaths = append(dataSrcPaths, android.PathsForModuleSrc(ctx, test.Properties.Host_common_data)...)
ctx.VisitDirectDepsProxyWithTag(dataLibDepTag, func(dep android.ModuleProxy) {
depName := ctx.OtherModuleName(dep)