summaryrefslogtreecommitdiff
path: root/python/test.go
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-01-29 11:25:22 -0800
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2025-01-29 11:25:22 -0800
commitef3ccc07568523a7aa904a0741f61e3a9621bb04 (patch)
tree55b282c2807e8055fbb5b6486596ea07cab7df30 /python/test.go
parentd2c82e1253469a518acf2cf6431ee966551da693 (diff)
parent5edca14ee0c0b5b6a0e1bb278e09c27993aa41d9 (diff)
Merge "Convert python_test's module-info.json to soong" into main
Diffstat (limited to 'python/test.go')
-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 {