From 3e178e4e994374992dad96eaf43ab688e536bdfd Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Wed, 29 Jan 2025 10:35:17 -0800 Subject: Install python tests to testcases/ in soong-only Needed for atest to work on python tests. Bug: 391924360 Test: atest vts_vndk_dependency_test Change-Id: Iabc05a58e4bbe958365a1027bcec25aa058ed1c9 --- python/test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'python') diff --git a/python/test.go b/python/test.go index 0f21771e4..5e70fc185 100644 --- a/python/test.go +++ b/python/test.go @@ -215,6 +215,22 @@ func (p *PythonTestModule) GenerateAndroidBuildActions(ctx android.ModuleContext installedData := ctx.InstallTestData(installDir, p.data) p.installedDest = ctx.InstallFile(installDir, p.installSource.Base(), p.installSource, installedData...) + // TODO: Remove the special case for kati + if !ctx.Config().KatiEnabled() { + // Install the test config in testcases/ directory for atest. + // Install configs in the root of $PRODUCT_OUT/testcases/$module + testCases := android.PathForModuleInPartitionInstall(ctx, "testcases", ctx.ModuleName()) + if ctx.PrimaryArch() { + if p.testConfig != nil { + ctx.InstallFile(testCases, ctx.ModuleName()+".config", p.testConfig) + } + } + // Install tests and data in arch specific subdir $PRODUCT_OUT/testcases/$module/$arch + testCases = testCases.Join(ctx, ctx.Target().Arch.ArchType.String()) + installedData := ctx.InstallTestData(testCases, p.data) + ctx.InstallFile(testCases, p.installSource.Base(), p.installSource, installedData...) + } + moduleInfoJSON := ctx.ModuleInfoJSON() moduleInfoJSON.Class = []string{"NATIVE_TESTS"} if len(p.binaryProperties.Test_suites) > 0 { -- cgit v1.2.3-59-g8ed1b