blob: 217a4e163ea0daccd08d2d3b33e2532ac73f7166 [file] [log] [blame]
Dan Willemsenb0552672019-01-25 16:04:11 -08001// Copyright 2019 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
Jaewoong Jung4b79e982020-06-01 10:45:49 -070015package sh
Dan Willemsenb0552672019-01-25 16:04:11 -080016
17import (
18 "fmt"
Colin Cross7c7c1142019-07-29 16:46:49 -070019 "path/filepath"
Jaewoong Jung6e0eee52020-05-29 16:15:32 -070020 "sort"
Julien Desprez9e7fc142019-03-08 11:07:05 -080021 "strings"
Jaewoong Jung4b79e982020-06-01 10:45:49 -070022
Jaewoong Jung6e0eee52020-05-29 16:15:32 -070023 "github.com/google/blueprint"
Jaewoong Jung4b79e982020-06-01 10:45:49 -070024 "github.com/google/blueprint/proptools"
25
26 "android/soong/android"
Jaewoong Jung6e0eee52020-05-29 16:15:32 -070027 "android/soong/cc"
frankfengc5b87492020-06-03 10:28:47 -070028 "android/soong/tradefed"
Dan Willemsenb0552672019-01-25 16:04:11 -080029)
30
31// sh_binary is for shell scripts (and batch files) that are installed as
32// executable files into .../bin/
33//
34// Do not use them for prebuilt C/C++/etc files. Use cc_prebuilt_binary
35// instead.
36
Jaewoong Jung4b79e982020-06-01 10:45:49 -070037var pctx = android.NewPackageContext("android/soong/sh")
38
Dan Willemsenb0552672019-01-25 16:04:11 -080039func init() {
Jaewoong Jung4b79e982020-06-01 10:45:49 -070040 pctx.Import("android/soong/android")
41
42 android.RegisterModuleType("sh_binary", ShBinaryFactory)
43 android.RegisterModuleType("sh_binary_host", ShBinaryHostFactory)
44 android.RegisterModuleType("sh_test", ShTestFactory)
45 android.RegisterModuleType("sh_test_host", ShTestHostFactory)
Dan Willemsenb0552672019-01-25 16:04:11 -080046}
47
48type shBinaryProperties struct {
49 // Source file of this prebuilt.
Colin Cross27b922f2019-03-04 22:35:41 -080050 Src *string `android:"path,arch_variant"`
Dan Willemsenb0552672019-01-25 16:04:11 -080051
52 // optional subdirectory under which this file is installed into
53 Sub_dir *string `android:"arch_variant"`
54
55 // optional name for the installed file. If unspecified, name of the module is used as the file name
56 Filename *string `android:"arch_variant"`
57
58 // when set to true, and filename property is not set, the name for the installed file
59 // is the same as the file name of the source file.
60 Filename_from_src *bool `android:"arch_variant"`
61
62 // Whether this module is directly installable to one of the partitions. Default: true.
63 Installable *bool
Rashed Abdel-Tawab6a341312019-10-04 20:38:01 -070064
65 // install symlinks to the binary
66 Symlinks []string `android:"arch_variant"`
Dan Willemsenb0552672019-01-25 16:04:11 -080067}
68
Julien Desprez9e7fc142019-03-08 11:07:05 -080069type TestProperties struct {
70 // list of compatibility suites (for example "cts", "vts") that the module should be
71 // installed into.
72 Test_suites []string `android:"arch_variant"`
73
74 // the name of the test configuration (for example "AndroidTest.xml") that should be
75 // installed with the module.
Colin Crossa6384822020-06-09 15:09:22 -070076 Test_config *string `android:"path,arch_variant"`
Jaewoong Jung8eaeb092019-05-16 14:58:29 -070077
78 // list of files or filegroup modules that provide data that should be installed alongside
79 // the test.
80 Data []string `android:"path,arch_variant"`
frankfengc5b87492020-06-03 10:28:47 -070081
82 // Add RootTargetPreparer to auto generated test config. This guarantees the test to run
83 // with root permission.
84 Require_root *bool
85
86 // the name of the test configuration template (for example "AndroidTestTemplate.xml") that
87 // should be installed with the module.
88 Test_config_template *string `android:"path,arch_variant"`
89
90 // Flag to indicate whether or not to create test config automatically. If AndroidTest.xml
91 // doesn't exist next to the Android.bp, this attribute doesn't need to be set to true
92 // explicitly.
93 Auto_gen_config *bool
Jaewoong Jung6e0eee52020-05-29 16:15:32 -070094
95 // list of binary modules that should be installed alongside the test
96 Data_bins []string `android:"path,arch_variant"`
97
98 // list of library modules that should be installed alongside the test
99 Data_libs []string `android:"path,arch_variant"`
100
101 // list of device binary modules that should be installed alongside the test.
102 // Only available for host sh_test modules.
103 Data_device_bins []string `android:"path,arch_variant"`
104
105 // list of device library modules that should be installed alongside the test.
106 // Only available for host sh_test modules.
107 Data_device_libs []string `android:"path,arch_variant"`
Julien Desprez9e7fc142019-03-08 11:07:05 -0800108}
109
Dan Willemsenb0552672019-01-25 16:04:11 -0800110type ShBinary struct {
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700111 android.ModuleBase
Dan Willemsenb0552672019-01-25 16:04:11 -0800112
113 properties shBinaryProperties
114
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700115 sourceFilePath android.Path
116 outputFilePath android.OutputPath
117 installedFile android.InstallPath
Dan Willemsenb0552672019-01-25 16:04:11 -0800118}
119
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700120var _ android.HostToolProvider = (*ShBinary)(nil)
Colin Cross7c7c1142019-07-29 16:46:49 -0700121
Julien Desprez9e7fc142019-03-08 11:07:05 -0800122type ShTest struct {
123 ShBinary
124
125 testProperties TestProperties
Jaewoong Jung8eaeb092019-05-16 14:58:29 -0700126
Jaewoong Jung4aedc862020-06-10 17:23:46 -0700127 installDir android.InstallPath
128
frankfengc5b87492020-06-03 10:28:47 -0700129 data android.Paths
130 testConfig android.Path
Jaewoong Jung6e0eee52020-05-29 16:15:32 -0700131
132 dataModules map[string]android.Path
Julien Desprez9e7fc142019-03-08 11:07:05 -0800133}
134
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700135func (s *ShBinary) HostToolPath() android.OptionalPath {
136 return android.OptionalPathForPath(s.installedFile)
Colin Cross7c7c1142019-07-29 16:46:49 -0700137}
138
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700139func (s *ShBinary) DepsMutator(ctx android.BottomUpMutatorContext) {
Dan Willemsenb0552672019-01-25 16:04:11 -0800140 if s.properties.Src == nil {
141 ctx.PropertyErrorf("src", "missing prebuilt source file")
142 }
Dan Willemsenb0552672019-01-25 16:04:11 -0800143}
144
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700145func (s *ShBinary) OutputFile() android.OutputPath {
Dan Willemsenb0552672019-01-25 16:04:11 -0800146 return s.outputFilePath
147}
148
149func (s *ShBinary) SubDir() string {
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700150 return proptools.String(s.properties.Sub_dir)
Dan Willemsenb0552672019-01-25 16:04:11 -0800151}
152
153func (s *ShBinary) Installable() bool {
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700154 return s.properties.Installable == nil || proptools.Bool(s.properties.Installable)
Dan Willemsenb0552672019-01-25 16:04:11 -0800155}
156
Rashed Abdel-Tawab6a341312019-10-04 20:38:01 -0700157func (s *ShBinary) Symlinks() []string {
158 return s.properties.Symlinks
159}
160
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700161func (s *ShBinary) generateAndroidBuildActions(ctx android.ModuleContext) {
162 s.sourceFilePath = android.PathForModuleSrc(ctx, proptools.String(s.properties.Src))
163 filename := proptools.String(s.properties.Filename)
164 filename_from_src := proptools.Bool(s.properties.Filename_from_src)
Dan Willemsenb0552672019-01-25 16:04:11 -0800165 if filename == "" {
166 if filename_from_src {
167 filename = s.sourceFilePath.Base()
168 } else {
169 filename = ctx.ModuleName()
170 }
171 } else if filename_from_src {
172 ctx.PropertyErrorf("filename_from_src", "filename is set. filename_from_src can't be true")
173 return
174 }
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700175 s.outputFilePath = android.PathForModuleOut(ctx, filename).OutputPath
Dan Willemsenb0552672019-01-25 16:04:11 -0800176
177 // This ensures that outputFilePath has the correct name for others to
178 // use, as the source file may have a different name.
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700179 ctx.Build(pctx, android.BuildParams{
180 Rule: android.CpExecutable,
Dan Willemsenb0552672019-01-25 16:04:11 -0800181 Output: s.outputFilePath,
182 Input: s.sourceFilePath,
183 })
184}
185
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700186func (s *ShBinary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
Colin Cross7c7c1142019-07-29 16:46:49 -0700187 s.generateAndroidBuildActions(ctx)
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700188 installDir := android.PathForModuleInstall(ctx, "bin", proptools.String(s.properties.Sub_dir))
Colin Cross7c7c1142019-07-29 16:46:49 -0700189 s.installedFile = ctx.InstallExecutable(installDir, s.outputFilePath.Base(), s.outputFilePath)
190}
191
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700192func (s *ShBinary) AndroidMkEntries() []android.AndroidMkEntries {
193 return []android.AndroidMkEntries{android.AndroidMkEntries{
Dan Willemsenb0552672019-01-25 16:04:11 -0800194 Class: "EXECUTABLES",
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700195 OutputFile: android.OptionalPathForPath(s.outputFilePath),
Dan Willemsenb0552672019-01-25 16:04:11 -0800196 Include: "$(BUILD_SYSTEM)/soong_cc_prebuilt.mk",
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700197 ExtraEntries: []android.AndroidMkExtraEntriesFunc{
198 func(entries *android.AndroidMkEntries) {
Jaewoong Junge0dc8df2019-08-27 17:33:16 -0700199 s.customAndroidMkEntries(entries)
Jaewoong Jung4aedc862020-06-10 17:23:46 -0700200 entries.SetString("LOCAL_MODULE_RELATIVE_PATH", proptools.String(s.properties.Sub_dir))
Jaewoong Junge0dc8df2019-08-27 17:33:16 -0700201 },
Dan Willemsenb0552672019-01-25 16:04:11 -0800202 },
Jiyong Park0b0e1b92019-12-03 13:24:29 +0900203 }}
Dan Willemsenb0552672019-01-25 16:04:11 -0800204}
205
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700206func (s *ShBinary) customAndroidMkEntries(entries *android.AndroidMkEntries) {
Jaewoong Jung8eaeb092019-05-16 14:58:29 -0700207 entries.SetString("LOCAL_MODULE_SUFFIX", "")
208 entries.SetString("LOCAL_MODULE_STEM", s.outputFilePath.Rel())
Rashed Abdel-Tawab6a341312019-10-04 20:38:01 -0700209 if len(s.properties.Symlinks) > 0 {
210 entries.SetString("LOCAL_MODULE_SYMLINKS", strings.Join(s.properties.Symlinks, " "))
211 }
Jaewoong Jung8eaeb092019-05-16 14:58:29 -0700212}
213
Jaewoong Jung6e0eee52020-05-29 16:15:32 -0700214type dependencyTag struct {
215 blueprint.BaseDependencyTag
216 name string
217}
218
219var (
220 shTestDataBinsTag = dependencyTag{name: "dataBins"}
221 shTestDataLibsTag = dependencyTag{name: "dataLibs"}
222 shTestDataDeviceBinsTag = dependencyTag{name: "dataDeviceBins"}
223 shTestDataDeviceLibsTag = dependencyTag{name: "dataDeviceLibs"}
224)
225
226var sharedLibVariations = []blueprint.Variation{{Mutator: "link", Variation: "shared"}}
227
228func (s *ShTest) DepsMutator(ctx android.BottomUpMutatorContext) {
229 s.ShBinary.DepsMutator(ctx)
230
231 ctx.AddFarVariationDependencies(ctx.Target().Variations(), shTestDataBinsTag, s.testProperties.Data_bins...)
232 ctx.AddFarVariationDependencies(append(ctx.Target().Variations(), sharedLibVariations...),
233 shTestDataLibsTag, s.testProperties.Data_libs...)
234 if ctx.Target().Os.Class == android.Host && len(ctx.Config().Targets[android.Android]) > 0 {
235 deviceVariations := ctx.Config().Targets[android.Android][0].Variations()
236 ctx.AddFarVariationDependencies(deviceVariations, shTestDataDeviceBinsTag, s.testProperties.Data_device_bins...)
237 ctx.AddFarVariationDependencies(append(deviceVariations, sharedLibVariations...),
238 shTestDataDeviceLibsTag, s.testProperties.Data_device_libs...)
239 } else if ctx.Target().Os.Class != android.Host {
240 if len(s.testProperties.Data_device_bins) > 0 {
241 ctx.PropertyErrorf("data_device_bins", "only available for host modules")
242 }
243 if len(s.testProperties.Data_device_libs) > 0 {
244 ctx.PropertyErrorf("data_device_libs", "only available for host modules")
245 }
246 }
247}
248
249func (s *ShTest) addToDataModules(ctx android.ModuleContext, relPath string, path android.Path) {
250 if _, exists := s.dataModules[relPath]; exists {
251 ctx.ModuleErrorf("data modules have a conflicting installation path, %v - %s, %s",
252 relPath, s.dataModules[relPath].String(), path.String())
253 return
254 }
255 s.dataModules[relPath] = path
256}
257
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700258func (s *ShTest) GenerateAndroidBuildActions(ctx android.ModuleContext) {
Colin Cross7c7c1142019-07-29 16:46:49 -0700259 s.ShBinary.generateAndroidBuildActions(ctx)
260 testDir := "nativetest"
261 if ctx.Target().Arch.ArchType.Multilib == "lib64" {
262 testDir = "nativetest64"
263 }
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700264 if ctx.Target().NativeBridge == android.NativeBridgeEnabled {
Colin Cross7c7c1142019-07-29 16:46:49 -0700265 testDir = filepath.Join(testDir, ctx.Target().NativeBridgeRelativePath)
266 } else if !ctx.Host() && ctx.Config().HasMultilibConflict(ctx.Arch().ArchType) {
267 testDir = filepath.Join(testDir, ctx.Arch().ArchType.String())
268 }
Jaewoong Jung4aedc862020-06-10 17:23:46 -0700269 if s.SubDir() != "" {
270 // Don't add the module name to the installation path if sub_dir is specified for backward
271 // compatibility.
272 s.installDir = android.PathForModuleInstall(ctx, testDir, s.SubDir())
273 } else {
274 s.installDir = android.PathForModuleInstall(ctx, testDir, s.Name())
275 }
276 s.installedFile = ctx.InstallExecutable(s.installDir, s.outputFilePath.Base(), s.outputFilePath)
Jaewoong Jung8eaeb092019-05-16 14:58:29 -0700277
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700278 s.data = android.PathsForModuleSrc(ctx, s.testProperties.Data)
frankfengc5b87492020-06-03 10:28:47 -0700279
280 var configs []tradefed.Config
281 if Bool(s.testProperties.Require_root) {
282 configs = append(configs, tradefed.Object{"target_preparer", "com.android.tradefed.targetprep.RootTargetPreparer", nil})
283 } else {
284 options := []tradefed.Option{{Name: "force-root", Value: "false"}}
285 configs = append(configs, tradefed.Object{"target_preparer", "com.android.tradefed.targetprep.RootTargetPreparer", options})
286 }
287 s.testConfig = tradefed.AutoGenShellTestConfig(ctx, s.testProperties.Test_config,
288 s.testProperties.Test_config_template, s.testProperties.Test_suites, configs, s.testProperties.Auto_gen_config, s.outputFilePath.Base())
Jaewoong Jung6e0eee52020-05-29 16:15:32 -0700289
290 s.dataModules = make(map[string]android.Path)
291 ctx.VisitDirectDeps(func(dep android.Module) {
292 depTag := ctx.OtherModuleDependencyTag(dep)
293 switch depTag {
294 case shTestDataBinsTag, shTestDataDeviceBinsTag:
295 if cc, isCc := dep.(*cc.Module); isCc {
296 s.addToDataModules(ctx, cc.OutputFile().Path().Base(), cc.OutputFile().Path())
297 return
298 }
299 property := "data_bins"
300 if depTag == shTestDataDeviceBinsTag {
301 property = "data_device_bins"
302 }
303 ctx.PropertyErrorf(property, "%q of type %q is not supported", dep.Name(), ctx.OtherModuleType(dep))
304 case shTestDataLibsTag, shTestDataDeviceLibsTag:
305 if cc, isCc := dep.(*cc.Module); isCc {
306 // Copy to an intermediate output directory to append "lib[64]" to the path,
307 // so that it's compatible with the default rpath values.
308 var relPath string
309 if cc.Arch().ArchType.Multilib == "lib64" {
310 relPath = filepath.Join("lib64", cc.OutputFile().Path().Base())
311 } else {
312 relPath = filepath.Join("lib", cc.OutputFile().Path().Base())
313 }
314 if _, exist := s.dataModules[relPath]; exist {
315 return
316 }
317 relocatedLib := android.PathForModuleOut(ctx, "relocated", relPath)
318 ctx.Build(pctx, android.BuildParams{
319 Rule: android.Cp,
320 Input: cc.OutputFile().Path(),
321 Output: relocatedLib,
322 })
323 s.addToDataModules(ctx, relPath, relocatedLib)
324 return
325 }
326 property := "data_libs"
327 if depTag == shTestDataDeviceBinsTag {
328 property = "data_device_libs"
329 }
330 ctx.PropertyErrorf(property, "%q of type %q is not supported", dep.Name(), ctx.OtherModuleType(dep))
331 }
332 })
Jaewoong Jung8eaeb092019-05-16 14:58:29 -0700333}
334
Colin Cross7c7c1142019-07-29 16:46:49 -0700335func (s *ShTest) InstallInData() bool {
336 return true
337}
338
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700339func (s *ShTest) AndroidMkEntries() []android.AndroidMkEntries {
340 return []android.AndroidMkEntries{android.AndroidMkEntries{
Jaewoong Jung8eaeb092019-05-16 14:58:29 -0700341 Class: "NATIVE_TESTS",
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700342 OutputFile: android.OptionalPathForPath(s.outputFilePath),
Jaewoong Jung8eaeb092019-05-16 14:58:29 -0700343 Include: "$(BUILD_SYSTEM)/soong_cc_prebuilt.mk",
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700344 ExtraEntries: []android.AndroidMkExtraEntriesFunc{
345 func(entries *android.AndroidMkEntries) {
Jaewoong Junge0dc8df2019-08-27 17:33:16 -0700346 s.customAndroidMkEntries(entries)
Jaewoong Jung4aedc862020-06-10 17:23:46 -0700347 entries.SetPath("LOCAL_MODULE_PATH", s.installDir.ToMakePath())
Jaewoong Junge0dc8df2019-08-27 17:33:16 -0700348 entries.AddStrings("LOCAL_COMPATIBILITY_SUITE", s.testProperties.Test_suites...)
Colin Crossa6384822020-06-09 15:09:22 -0700349 if s.testConfig != nil {
350 entries.SetPath("LOCAL_FULL_TEST_CONFIG", s.testConfig)
frankfengc5b87492020-06-03 10:28:47 -0700351 }
Jaewoong Junge0dc8df2019-08-27 17:33:16 -0700352 for _, d := range s.data {
353 rel := d.Rel()
354 path := d.String()
355 if !strings.HasSuffix(path, rel) {
356 panic(fmt.Errorf("path %q does not end with %q", path, rel))
357 }
358 path = strings.TrimSuffix(path, rel)
359 entries.AddStrings("LOCAL_TEST_DATA", path+":"+rel)
Jaewoong Jung8eaeb092019-05-16 14:58:29 -0700360 }
Jaewoong Jung6e0eee52020-05-29 16:15:32 -0700361 relPaths := make([]string, 0)
362 for relPath, _ := range s.dataModules {
363 relPaths = append(relPaths, relPath)
364 }
365 sort.Strings(relPaths)
366 for _, relPath := range relPaths {
367 dir := strings.TrimSuffix(s.dataModules[relPath].String(), relPath)
368 entries.AddStrings("LOCAL_TEST_DATA", dir+":"+relPath)
369 }
Jaewoong Junge0dc8df2019-08-27 17:33:16 -0700370 },
Jaewoong Jung8eaeb092019-05-16 14:58:29 -0700371 },
Jiyong Park0b0e1b92019-12-03 13:24:29 +0900372 }}
Julien Desprez9e7fc142019-03-08 11:07:05 -0800373}
374
Dan Willemsenb0552672019-01-25 16:04:11 -0800375func InitShBinaryModule(s *ShBinary) {
376 s.AddProperties(&s.properties)
377}
378
Patrice Arrudae1034192019-03-11 13:20:17 -0700379// sh_binary is for a shell script or batch file to be installed as an
380// executable binary to <partition>/bin.
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700381func ShBinaryFactory() android.Module {
Dan Willemsenb0552672019-01-25 16:04:11 -0800382 module := &ShBinary{}
383 InitShBinaryModule(module)
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700384 android.InitAndroidArchModule(module, android.HostAndDeviceSupported, android.MultilibFirst)
Dan Willemsenb0552672019-01-25 16:04:11 -0800385 return module
386}
387
Patrice Arrudae1034192019-03-11 13:20:17 -0700388// sh_binary_host is for a shell script to be installed as an executable binary
389// to $(HOST_OUT)/bin.
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700390func ShBinaryHostFactory() android.Module {
Dan Willemsenb0552672019-01-25 16:04:11 -0800391 module := &ShBinary{}
392 InitShBinaryModule(module)
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700393 android.InitAndroidArchModule(module, android.HostSupported, android.MultilibFirst)
Dan Willemsenb0552672019-01-25 16:04:11 -0800394 return module
395}
Julien Desprez9e7fc142019-03-08 11:07:05 -0800396
Jaewoong Jung61a83682019-07-01 09:08:50 -0700397// sh_test defines a shell script based test module.
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700398func ShTestFactory() android.Module {
Julien Desprez9e7fc142019-03-08 11:07:05 -0800399 module := &ShTest{}
400 InitShBinaryModule(&module.ShBinary)
401 module.AddProperties(&module.testProperties)
402
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700403 android.InitAndroidArchModule(module, android.HostAndDeviceSupported, android.MultilibFirst)
Julien Desprez9e7fc142019-03-08 11:07:05 -0800404 return module
405}
Jaewoong Jung61a83682019-07-01 09:08:50 -0700406
407// sh_test_host defines a shell script based test module that runs on a host.
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700408func ShTestHostFactory() android.Module {
Jaewoong Jung61a83682019-07-01 09:08:50 -0700409 module := &ShTest{}
410 InitShBinaryModule(&module.ShBinary)
411 module.AddProperties(&module.testProperties)
412
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700413 android.InitAndroidArchModule(module, android.HostSupported, android.MultilibFirst)
Jaewoong Jung61a83682019-07-01 09:08:50 -0700414 return module
415}
frankfengc5b87492020-06-03 10:28:47 -0700416
417var Bool = proptools.Bool