diff options
| author | 2024-02-23 03:58:16 +0000 | |
|---|---|---|
| committer | 2024-02-23 03:58:16 +0000 | |
| commit | df3f773e78784d7de1ef897348bbf29e347430ac (patch) | |
| tree | 4787e562a3f88d27f5ea9dcdb259bc7132e7ab94 /filesystem/filesystem_test.go | |
| parent | 35349466cd725513a997a2f7e1cd38e90f0397b8 (diff) | |
| parent | eec7c38eea6e5a68195138f7759f9c67baec9a28 (diff) | |
Merge changes I67893f8c,I5f29258e into main
* changes:
Ensure that filesystem module can track modules with prefer32
bpf modules can be included in filesystem modules
Diffstat (limited to 'filesystem/filesystem_test.go')
| -rw-r--r-- | filesystem/filesystem_test.go | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go index aef475650..c44810517 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,55 @@ func TestFileSystemDeps(t *testing.T) { result := fixture.RunTestWithBp(t, ` android_filesystem { name: "myfilesystem", + multilib: { + common: { + deps: [ + "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{ + "bin/foo", + "lib/libbar.so", + "lib64/libbar.so", + "etc/bpf/bpf.o", + } + for _, e := range expected { + android.AssertStringListContains(t, "missing entry", fs.entries, e) + } } func TestFileSystemFillsLinkerConfigWithStubLibs(t *testing.T) { |