Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 837486d3 authored by Paul Duffin's avatar Paul Duffin
Browse files

Convert java/boot_image_test.go to test fixtures

Bug: 177892522
Test: m nothing
Change-Id: I91d2bd2eabe5916fd158501bd0d4fdb608919019
parent 64be7bb3
Loading
Loading
Loading
Loading
+26 −12
Original line number Diff line number Diff line
@@ -16,13 +16,24 @@ package java

import (
	"testing"

	"android/soong/android"
	"android/soong/dexpreopt"
)

// 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.

var prepareForTestWithBootImage = android.GroupFixturePreparers(
	PrepareForTestWithJavaDefaultModules,
	dexpreopt.PrepareForTestByEnablingDexpreopt,
)

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 {
				name: "unknown-boot-image",
				image_name: "unknown",
@@ -31,7 +42,10 @@ func TestUnknownBootImage(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 {
				name: "unknown-boot-image",
				image_name: "unknown",