diff options
author | 2025-02-18 15:18:18 -0800 | |
---|---|---|
committer | 2025-02-18 15:19:56 -0800 | |
commit | b361442aa66c644efba22c6c3da846ac0644d86a (patch) | |
tree | df6345e8800f50ca577044e9fcd7ccde232bf475 /sh | |
parent | 6029aed8b971969c87f42cd940434f0fe1da904b (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 'sh')
-rw-r--r-- | sh/sh_binary.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sh/sh_binary.go b/sh/sh_binary.go index d753d246a..129ef0475 100644 --- a/sh/sh_binary.go +++ b/sh/sh_binary.go @@ -130,6 +130,11 @@ type TestProperties struct { // host test. Device_first_data []string `android:"path_device_first"` + // 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"` + // Add RootTargetPreparer to auto generated test config. This guarantees the test to run // with root permission. Require_root *bool @@ -422,6 +427,7 @@ func (s *ShTest) GenerateAndroidBuildActions(ctx android.ModuleContext) { expandedData := android.PathsForModuleSrc(ctx, s.testProperties.Data) expandedData = append(expandedData, android.PathsForModuleSrc(ctx, s.testProperties.Device_common_data)...) expandedData = append(expandedData, android.PathsForModuleSrc(ctx, s.testProperties.Device_first_data)...) + expandedData = append(expandedData, android.PathsForModuleSrc(ctx, s.testProperties.Host_common_data)...) // Emulate the data property for java_data dependencies. for _, javaData := range ctx.GetDirectDepsProxyWithTag(shTestJavaDataTag) { expandedData = append(expandedData, android.OutputFilesForModule(ctx, javaData, "")...) |