From d7556eb837c032f523a088e087d6ebeba1075690 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Mon, 2 Dec 2024 13:18:58 -0800 Subject: Support long commands in RuleBuilder If a command exceeds the linux max command line length, it will be put into a script instead. Fixes: 380945706 Test: Presubmits Change-Id: I9bc4b293d6d638b38e7fb11e6c2bc35196306d9f --- filesystem/filesystem_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'filesystem/filesystem_test.go') diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go index 746e4de74..72a52111c 100644 --- a/filesystem/filesystem_test.go +++ b/filesystem/filesystem_test.go @@ -16,6 +16,7 @@ package filesystem import ( "os" + "strings" "testing" "android/soong/android" @@ -182,10 +183,14 @@ func TestFileSystemFillsLinkerConfigWithStubLibs(t *testing.T) { module := result.ModuleForTests("myfilesystem", "android_common") output := module.Output("out/soong/.intermediates/myfilesystem/android_common/root/system/etc/linker.config.pb") + fullCommand := output.RuleParams.Command + startIndex := strings.Index(fullCommand, "conv_linker_config") + linkerConfigCommand := fullCommand[startIndex:] + android.AssertStringDoesContain(t, "linker.config.pb should have libfoo", - output.RuleParams.Command, "libfoo.so") + linkerConfigCommand, "libfoo.so") android.AssertStringDoesNotContain(t, "linker.config.pb should not have libbar", - output.RuleParams.Command, "libbar.so") + linkerConfigCommand, "libbar.so") } func registerComponent(ctx android.RegistrationContext) { -- cgit v1.2.3-59-g8ed1b