From 06c4cdcf87818cc48b723d5c47f617ca1c6e032a Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Fri, 16 Feb 2024 15:35:03 +0900 Subject: bpf modules can be included in filesystem modules Bug: 322246536 Test: go test ./... Change-Id: I5f29258e45475b30cdb26014c2db147182ec52fa --- filesystem/filesystem_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'filesystem/filesystem_test.go') diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go index aef475650..7547ff819 100644 --- a/filesystem/filesystem_test.go +++ b/filesystem/filesystem_test.go @@ -19,6 +19,7 @@ import ( "testing" "android/soong/android" + "android/soong/bpf" "android/soong/cc" "android/soong/etc" @@ -31,6 +32,7 @@ func TestMain(m *testing.M) { var fixture = android.GroupFixturePreparers( android.PrepareForIntegrationTestWithAndroid, + bpf.PrepareForTestWithBpf, etc.PrepareForTestWithPrebuiltEtc, cc.PrepareForIntegrationTestWithCc, PrepareForTestWithFilesystemBuildComponents, @@ -40,11 +42,29 @@ func TestFileSystemDeps(t *testing.T) { result := fixture.RunTestWithBp(t, ` android_filesystem { name: "myfilesystem", + multilib: { + common: { + deps: [ + "bpf.o", + ], + }, + }, + } + + bpf { + name: "bpf.o", + srcs: ["bpf.c"], } `) // produces "myfilesystem.img" result.ModuleForTests("myfilesystem", "android_common").Output("myfilesystem.img") + + fs := result.ModuleForTests("myfilesystem", "android_common").Module().(*filesystem) + expected := []string{"etc/bpf/bpf.o"} + for _, e := range expected { + android.AssertStringListContains(t, "missing entry", fs.entries, e) + } } func TestFileSystemFillsLinkerConfigWithStubLibs(t *testing.T) { -- cgit v1.2.3-59-g8ed1b From eec7c38eea6e5a68195138f7759f9c67baec9a28 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Fri, 16 Feb 2024 16:10:13 +0900 Subject: Ensure that filesystem module can track modules with prefer32 Bug: 321854616 Test: go test ./... Change-Id: I67893f8c32bd913ec6066e7055e1758a5bddb9a0 --- filesystem/filesystem_test.go | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'filesystem/filesystem_test.go') diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go index 7547ff819..c44810517 100644 --- a/filesystem/filesystem_test.go +++ b/filesystem/filesystem_test.go @@ -48,20 +48,46 @@ func TestFileSystemDeps(t *testing.T) { "bpf.o", ], }, + lib32: { + deps: [ + "foo", + "libbar", + ], + }, + lib64: { + deps: [ + "libbar", + ], + }, }, + compile_multilib: "both", } bpf { name: "bpf.o", srcs: ["bpf.c"], } + + cc_binary { + name: "foo", + compile_multilib: "prefer32", + } + + cc_library { + name: "libbar", + } `) // produces "myfilesystem.img" result.ModuleForTests("myfilesystem", "android_common").Output("myfilesystem.img") fs := result.ModuleForTests("myfilesystem", "android_common").Module().(*filesystem) - expected := []string{"etc/bpf/bpf.o"} + expected := []string{ + "bin/foo", + "lib/libbar.so", + "lib64/libbar.so", + "etc/bpf/bpf.o", + } for _, e := range expected { android.AssertStringListContains(t, "missing entry", fs.entries, e) } -- cgit v1.2.3-59-g8ed1b