Merge "Make apex/boot_image_test.go more realistic" am: 1b3d4923c1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652448 Change-Id: I852e2a4a1e001b03af4d1ebd10ee7193145cb570
This commit is contained in:
commit
86ce9334bf
1 changed files with 96 additions and 20 deletions
|
@ -160,24 +160,29 @@ func checkBootImage(t *testing.T, result *android.TestResult, moduleName string,
|
|||
android.AssertTrimmedStringEquals(t, "invalid paths for "+moduleName, expectedBootImageFiles, strings.Join(allPaths, "\n"))
|
||||
}
|
||||
|
||||
func TestBootImageInApex(t *testing.T) {
|
||||
func TestBootImageInArtApex(t *testing.T) {
|
||||
result := android.GroupFixturePreparers(
|
||||
prepareForTestWithBootImage,
|
||||
prepareForTestWithMyapex,
|
||||
// Configure some libraries in the framework boot image.
|
||||
dexpreopt.FixtureSetBootJars("platform:foo", "platform:bar"),
|
||||
prepareForTestWithArtApex,
|
||||
|
||||
// Configure some libraries in the art boot image.
|
||||
dexpreopt.FixtureSetArtBootJars("com.android.art:foo", "com.android.art:bar"),
|
||||
).RunTestWithBp(t, `
|
||||
apex {
|
||||
name: "myapex",
|
||||
key: "myapex.key",
|
||||
name: "com.android.art",
|
||||
key: "com.android.art.key",
|
||||
boot_images: [
|
||||
"mybootimage",
|
||||
],
|
||||
java_libs: [
|
||||
"foo",
|
||||
"bar",
|
||||
],
|
||||
updatable: false,
|
||||
}
|
||||
|
||||
apex_key {
|
||||
name: "myapex.key",
|
||||
name: "com.android.art.key",
|
||||
public_key: "testkey.avbpubkey",
|
||||
private_key: "testkey.pem",
|
||||
}
|
||||
|
@ -186,52 +191,123 @@ func TestBootImageInApex(t *testing.T) {
|
|||
name: "foo",
|
||||
srcs: ["b.java"],
|
||||
installable: true,
|
||||
apex_available: [
|
||||
"com.android.art",
|
||||
],
|
||||
}
|
||||
|
||||
java_library {
|
||||
name: "bar",
|
||||
srcs: ["b.java"],
|
||||
installable: true,
|
||||
apex_available: [
|
||||
"com.android.art",
|
||||
],
|
||||
}
|
||||
|
||||
boot_image {
|
||||
name: "mybootimage",
|
||||
image_name: "boot",
|
||||
image_name: "art",
|
||||
apex_available: [
|
||||
"myapex",
|
||||
"com.android.art",
|
||||
],
|
||||
}
|
||||
|
||||
// Make sure that a preferred prebuilt doesn't affect the apex.
|
||||
prebuilt_boot_image {
|
||||
name: "mybootimage",
|
||||
image_name: "boot",
|
||||
image_name: "art",
|
||||
prefer: true,
|
||||
apex_available: [
|
||||
"myapex",
|
||||
"com.android.art",
|
||||
],
|
||||
}
|
||||
`)
|
||||
|
||||
ensureExactContents(t, result.TestContext, "myapex", "android_common_myapex_image", []string{
|
||||
ensureExactContents(t, result.TestContext, "com.android.art", "android_common_com.android.art_image", []string{
|
||||
"javalib/arm/boot.art",
|
||||
"javalib/arm/boot.oat",
|
||||
"javalib/arm/boot.vdex",
|
||||
"javalib/arm/boot-bar.art",
|
||||
"javalib/arm/boot-bar.oat",
|
||||
"javalib/arm/boot-bar.vdex",
|
||||
"javalib/arm/boot-foo.art",
|
||||
"javalib/arm/boot-foo.oat",
|
||||
"javalib/arm/boot-foo.vdex",
|
||||
"javalib/arm64/boot.art",
|
||||
"javalib/arm64/boot.oat",
|
||||
"javalib/arm64/boot.vdex",
|
||||
"javalib/arm64/boot-bar.art",
|
||||
"javalib/arm64/boot-bar.oat",
|
||||
"javalib/arm64/boot-bar.vdex",
|
||||
"javalib/arm64/boot-foo.art",
|
||||
"javalib/arm64/boot-foo.oat",
|
||||
"javalib/arm64/boot-foo.vdex",
|
||||
"javalib/bar.jar",
|
||||
"javalib/foo.jar",
|
||||
})
|
||||
|
||||
java.CheckModuleDependencies(t, result.TestContext, "myapex", "android_common_myapex_image", []string{
|
||||
`myapex.key`,
|
||||
java.CheckModuleDependencies(t, result.TestContext, "com.android.art", "android_common_com.android.art_image", []string{
|
||||
`bar`,
|
||||
`com.android.art.key`,
|
||||
`foo`,
|
||||
`mybootimage`,
|
||||
})
|
||||
}
|
||||
|
||||
func TestBootImageInPrebuiltArtApex(t *testing.T) {
|
||||
result := android.GroupFixturePreparers(
|
||||
prepareForTestWithBootImage,
|
||||
prepareForTestWithArtApex,
|
||||
|
||||
android.FixtureMergeMockFs(android.MockFS{
|
||||
"com.android.art-arm64.apex": nil,
|
||||
"com.android.art-arm.apex": nil,
|
||||
}),
|
||||
|
||||
// Configure some libraries in the art boot image.
|
||||
dexpreopt.FixtureSetArtBootJars("com.android.art:foo", "com.android.art:bar"),
|
||||
).RunTestWithBp(t, `
|
||||
prebuilt_apex {
|
||||
name: "com.android.art",
|
||||
arch: {
|
||||
arm64: {
|
||||
src: "com.android.art-arm64.apex",
|
||||
},
|
||||
arm: {
|
||||
src: "com.android.art-arm.apex",
|
||||
},
|
||||
},
|
||||
exported_java_libs: ["foo", "bar"],
|
||||
}
|
||||
|
||||
java_import {
|
||||
name: "foo",
|
||||
jars: ["foo.jar"],
|
||||
apex_available: [
|
||||
"com.android.art",
|
||||
],
|
||||
}
|
||||
|
||||
java_import {
|
||||
name: "bar",
|
||||
jars: ["bar.jar"],
|
||||
apex_available: [
|
||||
"com.android.art",
|
||||
],
|
||||
}
|
||||
|
||||
prebuilt_boot_image {
|
||||
name: "mybootimage",
|
||||
image_name: "art",
|
||||
apex_available: [
|
||||
"com.android.art",
|
||||
],
|
||||
}
|
||||
`)
|
||||
|
||||
java.CheckModuleDependencies(t, result.TestContext, "com.android.art", "android_common", []string{
|
||||
`prebuilt_bar`,
|
||||
`prebuilt_foo`,
|
||||
})
|
||||
|
||||
java.CheckModuleDependencies(t, result.TestContext, "mybootimage", "android_common", []string{
|
||||
`dex2oatd`,
|
||||
})
|
||||
}
|
||||
|
||||
// TODO(b/177892522) - add test for host apex.
|
||||
|
|
Loading…
Reference in a new issue