diff options
author | 2025-01-29 17:09:40 -0800 | |
---|---|---|
committer | 2025-01-29 17:09:40 -0800 | |
commit | 1fba600010a9162c95de1304172537cce8f9fb01 (patch) | |
tree | acf38915b2d344d8b8e37e1203426da00a8e4a52 | |
parent | 3288fda8dbf9b936bb85765f6d4989c2b4abd997 (diff) | |
parent | 3094ba0b7d50728f0930b67931e7c2474f202fd2 (diff) |
Merge "Install rust test and deps in testcases/ in soong-only" into main
-rw-r--r-- | rust/test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/rust/test.go b/rust/test.go index 9a59117cc..b658ae252 100644 --- a/rust/test.go +++ b/rust/test.go @@ -195,6 +195,27 @@ 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) } + + if !ctx.Config().KatiEnabled() { // TODO(spandandas): Remove the special case for kati + // Install the test config in testcases/ directory for atest. + r, ok := ctx.Module().(*Module) + if !ok { + ctx.ModuleErrorf("Not a rust test module") + } + // Install configs in the root of $PRODUCT_OUT/testcases/$module + testCases := android.PathForModuleInPartitionInstall(ctx, "testcases", ctx.ModuleName()+r.SubName()) + if ctx.PrimaryArch() { + if test.testConfig != nil { + ctx.InstallFile(testCases, ctx.ModuleName()+".config", test.testConfig) + } + } + // Install tests and data in arch specific subdir $PRODUCT_OUT/testcases/$module/$arch + testCases = testCases.Join(ctx, ctx.Target().Arch.ArchType.String()) + ctx.InstallTestData(testCases, test.data) + testPath := ctx.RustModule().OutputFile().Path() + ctx.InstallFile(testCases, testPath.Base(), testPath) + } + test.binaryDecorator.installTestData(ctx, test.data) test.binaryDecorator.install(ctx) } |