summaryrefslogtreecommitdiff
path: root/filesystem/filesystem_test.go
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2024-10-23 20:22:38 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2024-10-23 20:22:38 +0000
commitbf1a7574b7d1ca32b82a4ee8dd9b092e4a6e6116 (patch)
treeebc7c36635c1cf979a3681b39ae7824519a884f3 /filesystem/filesystem_test.go
parent2ea50e17c72dc055a09b0307c3d7789e87a61158 (diff)
parent6c2b01d2059569554e6178f2f3d6cfe7c37e30ad (diff)
Merge "Do not install transitive packaging specs of overriden modules" into main
Diffstat (limited to 'filesystem/filesystem_test.go')
-rw-r--r--filesystem/filesystem_test.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go
index ab63550ca..730006116 100644
--- a/filesystem/filesystem_test.go
+++ b/filesystem/filesystem_test.go
@@ -629,3 +629,38 @@ func TestUseSharedVariationOfNativeLib(t *testing.T) {
fileList := android.ContentFromFileRuleForTests(t, result.TestContext, partition.Output("fileList"))
android.AssertDeepEquals(t, "cc_library listed in deps", "lib64/libc++.so\nlib64/libc.so\nlib64/libdl.so\nlib64/libfoo.so\nlib64/libm.so\n", fileList)
}
+
+// binfoo1 overrides binbar. transitive deps of binbar should not be installed.
+func TestDoNotInstallTransitiveDepOfOverriddenModule(t *testing.T) {
+ result := fixture.RunTestWithBp(t, `
+android_filesystem {
+ name: "myfilesystem",
+ deps: ["binfoo1", "libfoo2", "binbar"],
+}
+cc_binary {
+ name: "binfoo1",
+ shared_libs: ["libfoo"],
+ overrides: ["binbar"],
+}
+cc_library {
+ name: "libfoo",
+}
+cc_library {
+ name: "libfoo2",
+ overrides: ["libfoo"],
+}
+// binbar gets overridden by binfoo1
+// therefore, libbar should not be installed
+cc_binary {
+ name: "binbar",
+ shared_libs: ["libbar"]
+}
+cc_library {
+ name: "libbar",
+}
+ `)
+
+ partition := result.ModuleForTests("myfilesystem", "android_common")
+ fileList := android.ContentFromFileRuleForTests(t, result.TestContext, partition.Output("fileList"))
+ android.AssertDeepEquals(t, "Shared library dep of overridden binary should not be installed", fileList, "bin/binfoo1\nlib64/libc++.so\nlib64/libc.so\nlib64/libdl.so\nlib64/libfoo2.so\nlib64/libm.so\n")
+}