From 5edca14ee0c0b5b6a0e1bb278e09c27993aa41d9 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Tue, 28 Jan 2025 16:47:17 -0800 Subject: Convert python_test's module-info.json to soong This causes the python launcher's shared libs to no longer be listed under the "required" field, but that seems to not be necessary to still run python tests with atest. Bug: 389720048 Test: atest vts_vndk_dependency_test Change-Id: I7eb96af18aeb550530799431c8bacceb581f66c2 --- python/test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'python') diff --git a/python/test.go b/python/test.go index c780a6f62..0f21771e4 100644 --- a/python/test.go +++ b/python/test.go @@ -214,6 +214,30 @@ func (p *PythonTestModule) GenerateAndroidBuildActions(ctx android.ModuleContext installDir := installDir(ctx, "nativetest", "nativetest64", ctx.ModuleName()) installedData := ctx.InstallTestData(installDir, p.data) p.installedDest = ctx.InstallFile(installDir, p.installSource.Base(), p.installSource, installedData...) + + moduleInfoJSON := ctx.ModuleInfoJSON() + moduleInfoJSON.Class = []string{"NATIVE_TESTS"} + if len(p.binaryProperties.Test_suites) > 0 { + moduleInfoJSON.CompatibilitySuites = append(moduleInfoJSON.CompatibilitySuites, p.binaryProperties.Test_suites...) + } else { + moduleInfoJSON.CompatibilitySuites = append(moduleInfoJSON.CompatibilitySuites, "null-suite") + } + if p.testConfig != nil { + moduleInfoJSON.TestConfig = append(moduleInfoJSON.TestConfig, p.testConfig.String()) + } + if _, ok := p.testConfig.(android.WritablePath); ok { + moduleInfoJSON.AutoTestConfig = []string{"true"} + } + moduleInfoJSON.TestOptionsTags = append(moduleInfoJSON.TestOptionsTags, p.testProperties.Test_options.Tags...) + moduleInfoJSON.Dependencies = append(moduleInfoJSON.Dependencies, p.androidMkSharedLibs...) + moduleInfoJSON.SharedLibs = append(moduleInfoJSON.Dependencies, p.androidMkSharedLibs...) + moduleInfoJSON.SystemSharedLibs = []string{"none"} + if proptools.Bool(p.testProperties.Test_options.Unit_test) { + moduleInfoJSON.IsUnitTest = "true" + if p.isTestHost() { + moduleInfoJSON.CompatibilitySuites = append(moduleInfoJSON.CompatibilitySuites, "host-unit-tests") + } + } } func (p *PythonTestModule) AndroidMkEntries() []android.AndroidMkEntries { -- cgit v1.2.3-59-g8ed1b