Add android_system_image_defaults
Bug: 330665150 Test: go test ./... under filesystem Change-Id: Id32e6563491a3d129042de4a9517c545543a022d
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user