summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2025-01-28 16:47:17 -0800
committer Cole Faust <colefaust@google.com> 2025-01-29 10:20:12 -0800
commit5edca14ee0c0b5b6a0e1bb278e09c27993aa41d9 (patch)
treeb1daf4a72ed8baf03bfb61ed04774f914aef4459
parentc159fddcbb8ff8b6a5e3171118394954c7d7cbbf (diff)
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
-rw-r--r--python/test.go24
1 files changed, 24 insertions, 0 deletions
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 {