Merge "Convert java/boot_image_test.go to test fixtures" am: 60fbea0ec6
am: 9b66f48c17
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652450 Change-Id: I8d726e6dc502f7821834ac03facd7bcd7b70c381
This commit is contained in:
@@ -16,13 +16,24 @@ package java
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"android/soong/android"
|
||||||
|
"android/soong/dexpreopt"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Contains some simple tests for boot_image logic, additional tests can be found in
|
// Contains some simple tests for boot_image logic, additional tests can be found in
|
||||||
// apex/boot_image_test.go as the ART boot image requires modules from the ART apex.
|
// apex/boot_image_test.go as the ART boot image requires modules from the ART apex.
|
||||||
|
|
||||||
|
var prepareForTestWithBootImage = android.GroupFixturePreparers(
|
||||||
|
PrepareForTestWithJavaDefaultModules,
|
||||||
|
dexpreopt.PrepareForTestByEnablingDexpreopt,
|
||||||
|
)
|
||||||
|
|
||||||
func TestUnknownBootImage(t *testing.T) {
|
func TestUnknownBootImage(t *testing.T) {
|
||||||
testJavaError(t, "image_name: Unknown image name \\\"unknown\\\", expected one of art, boot", `
|
prepareForTestWithBootImage.
|
||||||
|
ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern(
|
||||||
|
`\Qimage_name: Unknown image name "unknown", expected one of art, boot\E`)).
|
||||||
|
RunTestWithBp(t, `
|
||||||
boot_image {
|
boot_image {
|
||||||
name: "unknown-boot-image",
|
name: "unknown-boot-image",
|
||||||
image_name: "unknown",
|
image_name: "unknown",
|
||||||
@@ -31,7 +42,10 @@ func TestUnknownBootImage(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestUnknownPrebuiltBootImage(t *testing.T) {
|
func TestUnknownPrebuiltBootImage(t *testing.T) {
|
||||||
testJavaError(t, "image_name: Unknown image name \\\"unknown\\\", expected one of art, boot", `
|
prepareForTestWithBootImage.
|
||||||
|
ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern(
|
||||||
|
`\Qimage_name: Unknown image name "unknown", expected one of art, boot\E`)).
|
||||||
|
RunTestWithBp(t, `
|
||||||
prebuilt_boot_image {
|
prebuilt_boot_image {
|
||||||
name: "unknown-boot-image",
|
name: "unknown-boot-image",
|
||||||
image_name: "unknown",
|
image_name: "unknown",
|
||||||
|
Reference in New Issue
Block a user