apex: fix a test util (ensureExactContent)
ensureExactContent shouldn't return immediately when it finds a match from expected list of files. Bug: N/A Test: m nothing Change-Id: Ie15c811f9cfcae7ede28dee0fcf203cee24659a0
This commit is contained in:
@@ -1532,14 +1532,18 @@ func ensureExactContents(t *testing.T, ctx *android.TestContext, moduleName, var
|
|||||||
var surplus []string
|
var surplus []string
|
||||||
filesMatched := make(map[string]bool)
|
filesMatched := make(map[string]bool)
|
||||||
for _, file := range getFiles(t, ctx, moduleName, variant) {
|
for _, file := range getFiles(t, ctx, moduleName, variant) {
|
||||||
|
mactchFound := false
|
||||||
for _, expected := range files {
|
for _, expected := range files {
|
||||||
if matched, _ := path.Match(expected, file.path); matched {
|
if matched, _ := path.Match(expected, file.path); matched {
|
||||||
filesMatched[expected] = true
|
filesMatched[expected] = true
|
||||||
return
|
mactchFound = true
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if !mactchFound {
|
||||||
surplus = append(surplus, file.path)
|
surplus = append(surplus, file.path)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if len(surplus) > 0 {
|
if len(surplus) > 0 {
|
||||||
sort.Strings(surplus)
|
sort.Strings(surplus)
|
||||||
@@ -1605,8 +1609,10 @@ func TestVndkApexCurrent(t *testing.T) {
|
|||||||
ensureExactContents(t, ctx, "myapex", "android_common_image", []string{
|
ensureExactContents(t, ctx, "myapex", "android_common_image", []string{
|
||||||
"lib/libvndk.so",
|
"lib/libvndk.so",
|
||||||
"lib/libvndksp.so",
|
"lib/libvndksp.so",
|
||||||
|
"lib/libc++.so",
|
||||||
"lib64/libvndk.so",
|
"lib64/libvndk.so",
|
||||||
"lib64/libvndksp.so",
|
"lib64/libvndksp.so",
|
||||||
|
"lib64/libc++.so",
|
||||||
"etc/llndk.libraries.VER.txt",
|
"etc/llndk.libraries.VER.txt",
|
||||||
"etc/vndkcore.libraries.VER.txt",
|
"etc/vndkcore.libraries.VER.txt",
|
||||||
"etc/vndksp.libraries.VER.txt",
|
"etc/vndksp.libraries.VER.txt",
|
||||||
@@ -1666,6 +1672,8 @@ func TestVndkApexWithPrebuilt(t *testing.T) {
|
|||||||
"lib/libvndk.so",
|
"lib/libvndk.so",
|
||||||
"lib/libvndk.arm.so",
|
"lib/libvndk.arm.so",
|
||||||
"lib64/libvndk.so",
|
"lib64/libvndk.so",
|
||||||
|
"lib/libc++.so",
|
||||||
|
"lib64/libc++.so",
|
||||||
"etc/*",
|
"etc/*",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -1877,6 +1885,8 @@ func TestVndkApexSkipsNativeBridgeSupportedModules(t *testing.T) {
|
|||||||
ensureExactContents(t, ctx, "myapex", "android_common_image", []string{
|
ensureExactContents(t, ctx, "myapex", "android_common_image", []string{
|
||||||
"lib/libvndk.so",
|
"lib/libvndk.so",
|
||||||
"lib64/libvndk.so",
|
"lib64/libvndk.so",
|
||||||
|
"lib/libc++.so",
|
||||||
|
"lib64/libc++.so",
|
||||||
"etc/*",
|
"etc/*",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user