diff options
| -rw-r--r-- | cc/cc.go | 4 | ||||
| -rw-r--r-- | cc/test.go | 16 |
2 files changed, 20 insertions, 0 deletions
@@ -95,6 +95,7 @@ type Deps struct { // Used for data dependencies adjacent to tests DataLibs []string + DataBins []string // Used by DepsMutator to pass system_shared_libs information to check_elf_file.py. SystemSharedLibs []string @@ -718,6 +719,7 @@ var ( staticVariantTag = dependencyTag{name: "static variant"} vndkExtDepTag = dependencyTag{name: "vndk extends"} dataLibDepTag = dependencyTag{name: "data lib"} + dataBinDepTag = dependencyTag{name: "data bin"} runtimeDepTag = installDependencyTag{name: "runtime lib"} testPerSrcDepTag = dependencyTag{name: "test_per_src"} stubImplDepTag = dependencyTag{name: "stub_impl"} @@ -2274,6 +2276,8 @@ func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) { {Mutator: "link", Variation: "shared"}, }, dataLibDepTag, deps.DataLibs...) + actx.AddVariationDependencies(nil, dataBinDepTag, deps.DataBins...) + actx.AddVariationDependencies([]blueprint.Variation{ {Mutator: "link", Variation: "shared"}, }, runtimeDepTag, deps.RuntimeLibs...) diff --git a/cc/test.go b/cc/test.go index 4328628d4..c589165f0 100644 --- a/cc/test.go +++ b/cc/test.go @@ -80,6 +80,9 @@ type TestBinaryProperties struct { // list of shared library modules that should be installed alongside the test Data_libs []string `android:"arch_variant"` + // list of binary modules that should be installed alongside the test + Data_bins []string `android:"arch_variant"` + // list of compatibility suites (for example "cts", "vts") that the module should be // installed into. Test_suites []string `android:"arch_variant"` @@ -350,6 +353,7 @@ func (test *testBinary) linkerDeps(ctx DepsContext, deps Deps) Deps { deps = test.testDecorator.linkerDeps(ctx, deps) deps = test.binaryDecorator.linkerDeps(ctx, deps) deps.DataLibs = append(deps.DataLibs, test.Properties.Data_libs...) + deps.DataBins = append(deps.DataBins, test.Properties.Data_bins...) return deps } @@ -389,6 +393,18 @@ func (test *testBinary) install(ctx ModuleContext, file android.Path) { RelativeInstallPath: ccModule.installer.relativeInstallPath()}) } }) + ctx.VisitDirectDepsWithTag(dataBinDepTag, func(dep android.Module) { + depName := ctx.OtherModuleName(dep) + ccModule, ok := dep.(*Module) + if !ok { + ctx.ModuleErrorf("data_bin %q is not a cc module", depName) + } + if ccModule.OutputFile().Valid() { + test.data = append(test.data, + android.DataPath{SrcPath: ccModule.OutputFile().Path(), + RelativeInstallPath: ccModule.installer.relativeInstallPath()}) + } + }) var configs []tradefed.Config for _, module := range test.Properties.Test_mainline_modules { |