summaryrefslogtreecommitdiff
path: root/filesystem/filesystem_test.go
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-04-01 18:52:35 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2024-04-01 18:52:35 +0000
commitab1296abc8f3443eb0f43f044d07a18c269f0628 (patch)
tree1ed4975aa504c12a68f0e67c9c02c360b719566c /filesystem/filesystem_test.go
parent488868ddf40558629eba2d1b1a2c23b0648ace95 (diff)
parenteaac823f19077987f8f1dbc493fa90b8abb566a5 (diff)
Merge "Add android_system_image_defaults" into main
Diffstat (limited to 'filesystem/filesystem_test.go')
-rw-r--r--filesystem/filesystem_test.go69
1 files changed, 69 insertions, 0 deletions
diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go
index d5ea2bc17..5c780f874 100644
--- a/filesystem/filesystem_test.go
+++ b/filesystem/filesystem_test.go
@@ -364,3 +364,72 @@ func TestFileSystemWithCoverageVariants(t *testing.T) {
t.Error("prebuilt should use cov variant of filesystem")
}
}
+
+func TestSystemImageDefaults(t *testing.T) {
+ result := fixture.RunTestWithBp(t, `
+ android_system_image_defaults {
+ name: "defaults",
+ multilib: {
+ common: {
+ deps: [
+ "phony",
+ ],
+ },
+ lib64: {
+ deps: [
+ "libbar",
+ ],
+ },
+ },
+ compile_multilib: "both",
+ }
+
+ android_system_image {
+ name: "system",
+ defaults: ["defaults"],
+ multilib: {
+ lib32: {
+ deps: [
+ "foo",
+ "libbar",
+ ],
+ },
+ },
+ }
+
+ cc_binary {
+ name: "foo",
+ compile_multilib: "prefer32",
+ }
+
+ cc_library {
+ name: "libbar",
+ required: ["libbaz"],
+ }
+
+ cc_library {
+ name: "libbaz",
+ }
+
+ phony {
+ name: "phony",
+ required: ["libquz"],
+ }
+
+ cc_library {
+ name: "libquz",
+ }
+ `)
+
+ fs := result.ModuleForTests("system", "android_common").Module().(*systemImage)
+ expected := []string{
+ "bin/foo",
+ "lib/libbar.so",
+ "lib64/libbar.so",
+ "lib64/libbaz.so",
+ "lib64/libquz.so",
+ }
+ for _, e := range expected {
+ android.AssertStringListContains(t, "missing entry", fs.entries, e)
+ }
+}