diff options
author | 2025-02-18 11:17:11 +0000 | |
---|---|---|
committer | 2025-02-19 03:06:20 +0000 | |
commit | 7bf70a1b591dfd83a5a4b1c37130e14aaf4b36ee (patch) | |
tree | d43373201c85b8e3847f075a73dc6b32d85dbd27 /sh/sh_binary.go | |
parent | 6225cbd51df26f0da31ea9269fca635ce6af93f9 (diff) |
Convert sh_test_host modules' module-info.json to Soong
Bug: 397158845
Test: m out/target/product/vsoc_x86_64/module-info.json
Test: Inspect module-info.json diff, CI
Change-Id: Ib98a4850189b57f77d18d0aaa2ab91e1690ec965
Diffstat (limited to 'sh/sh_binary.go')
-rw-r--r-- | sh/sh_binary.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sh/sh_binary.go b/sh/sh_binary.go index d753d246a..77066f149 100644 --- a/sh/sh_binary.go +++ b/sh/sh_binary.go @@ -530,6 +530,28 @@ func (s *ShTest) GenerateAndroidBuildActions(ctx android.ModuleContext) { MkAppClass: mkEntries.Class, InstallDir: s.installDir, }) + + moduleInfoJSON := ctx.ModuleInfoJSON() + moduleInfoJSON.Class = []string{"NATIVE_TESTS"} + if len(s.testProperties.Test_suites) > 0 { + moduleInfoJSON.CompatibilitySuites = append(moduleInfoJSON.CompatibilitySuites, s.testProperties.Test_suites...) + } else { + moduleInfoJSON.CompatibilitySuites = append(moduleInfoJSON.CompatibilitySuites, "null-suite") + } + if proptools.Bool(s.testProperties.Test_options.Unit_test) { + moduleInfoJSON.IsUnitTest = "true" + if ctx.Host() { + moduleInfoJSON.CompatibilitySuites = append(moduleInfoJSON.CompatibilitySuites, "host-unit-tests") + } + } + moduleInfoJSON.DataDependencies = append(moduleInfoJSON.DataDependencies, s.testProperties.Data_bins...) + if s.testConfig != nil { + if _, ok := s.testConfig.(android.WritablePath); ok { + moduleInfoJSON.AutoTestConfig = []string{"true"} + } + moduleInfoJSON.TestConfig = append(moduleInfoJSON.TestConfig, s.testConfig.String()) + } + moduleInfoJSON.TestConfig = append(moduleInfoJSON.TestConfig, s.extraTestConfigs.Strings()...) } func addArch(archType string, paths android.Paths) []string { |