diff options
| author | 2024-05-16 00:33:24 +0000 | |
|---|---|---|
| committer | 2024-05-16 00:33:24 +0000 | |
| commit | c6541077deff038a0da3b944b06f919609405264 (patch) | |
| tree | 27b8a37982bd51bbc4a00dfa152f764c8882ed2f /filesystem/filesystem_test.go | |
| parent | 277e444cb3184824580d4a09b0bdc591159f2d17 (diff) | |
| parent | c6a773df6493ac4697d9e6ad244028a54eceabec (diff) | |
Merge "Filter-out deps of unsupported arch" into main
Diffstat (limited to 'filesystem/filesystem_test.go')
| -rw-r--r-- | filesystem/filesystem_test.go | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go index 861918f16..015d39aab 100644 --- a/filesystem/filesystem_test.go +++ b/filesystem/filesystem_test.go @@ -497,3 +497,70 @@ func TestTrackPhonyAsRequiredDep(t *testing.T) { android.AssertStringListContains(t, "missing entry", fs.entries, e) } } + +func TestFilterOutUnsupportedArches(t *testing.T) { + result := fixture.RunTestWithBp(t, ` + android_filesystem { + name: "fs_64_only", + deps: ["foo"], + } + + android_filesystem { + name: "fs_64_32", + compile_multilib: "both", + multilib: { + first: { + deps: ["foo"], + }, + }, + } + + cc_binary { + name: "foo", + required: ["phony"], + } + + phony { + name: "phony", + required: [ + "libbar", + "app", + ], + } + + cc_library { + name: "libbar", + } + + android_app { + name: "app", + srcs: ["a.java"], + platform_apis: true, + } + `) + testcases := []struct { + fsName string + expected []string + unexpected []string + }{ + { + fsName: "fs_64_only", + expected: []string{"app/app/app.apk", "bin/foo", "lib64/libbar.so"}, + unexpected: []string{"lib/libbar.so"}, + }, + { + fsName: "fs_64_32", + expected: []string{"app/app/app.apk", "bin/foo", "lib64/libbar.so", "lib/libbar.so"}, + unexpected: []string{}, + }, + } + for _, c := range testcases { + fs := result.ModuleForTests(c.fsName, "android_common").Module().(*filesystem) + for _, e := range c.expected { + android.AssertStringListContains(t, "missing entry", fs.entries, e) + } + for _, e := range c.unexpected { + android.AssertStringListDoesNotContain(t, "unexpected entry", fs.entries, e) + } + } +} |