Prevent sh_test from migrating as sh_binary

Test: CI
Change-Id: I4cb789e3f1351fcb1635d58b72c265eac4bf62d8
This commit is contained in:
Liz Kammer 2023-04-28 17:39:24 -04:00
parent 12d170dc2a
commit 9b2ca5c8c9

View file

@ -474,16 +474,18 @@ func (s *ShTest) AndroidMkEntries() []android.AndroidMkEntries {
}}
}
func InitShBinaryModule(s *ShBinary) {
func initShBinaryModule(s *ShBinary, useBazel bool) {
s.AddProperties(&s.properties)
if useBazel {
android.InitBazelModule(s)
}
}
// sh_binary is for a shell script or batch file to be installed as an
// executable binary to <partition>/bin.
func ShBinaryFactory() android.Module {
module := &ShBinary{}
InitShBinaryModule(module)
initShBinaryModule(module, true)
android.InitAndroidArchModule(module, android.HostAndDeviceSupported, android.MultilibFirst)
return module
}
@ -492,7 +494,7 @@ func ShBinaryFactory() android.Module {
// to $(HOST_OUT)/bin.
func ShBinaryHostFactory() android.Module {
module := &ShBinary{}
InitShBinaryModule(module)
initShBinaryModule(module, true)
android.InitAndroidArchModule(module, android.HostSupported, android.MultilibFirst)
return module
}
@ -500,7 +502,7 @@ func ShBinaryHostFactory() android.Module {
// sh_test defines a shell script based test module.
func ShTestFactory() android.Module {
module := &ShTest{}
InitShBinaryModule(&module.ShBinary)
initShBinaryModule(&module.ShBinary, false)
module.AddProperties(&module.testProperties)
android.InitAndroidArchModule(module, android.HostAndDeviceSupported, android.MultilibFirst)
@ -510,7 +512,7 @@ func ShTestFactory() android.Module {
// sh_test_host defines a shell script based test module that runs on a host.
func ShTestHostFactory() android.Module {
module := &ShTest{}
InitShBinaryModule(&module.ShBinary)
initShBinaryModule(&module.ShBinary, false)
module.AddProperties(&module.testProperties)
// Default sh_test_host to unit_tests = true
if module.testProperties.Test_options.Unit_test == nil {