Prune test preparers in apex/boot_image_test.go
Cut down the preparers to only those needed by these tests. Bug: 177892522 Test: m nothing Change-Id: I811977b0331dd38c25623aa96e09e85ba5cf7c57
This commit is contained in:
@@ -140,13 +140,13 @@ var apexFixtureFactory = android.NewFixtureFactory(
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
`),
|
`),
|
||||||
|
prepareForTestWithMyapex,
|
||||||
android.FixtureMergeMockFs(android.MockFS{
|
android.FixtureMergeMockFs(android.MockFS{
|
||||||
"a.java": nil,
|
"a.java": nil,
|
||||||
"PrebuiltAppFoo.apk": nil,
|
"PrebuiltAppFoo.apk": nil,
|
||||||
"PrebuiltAppFooPriv.apk": nil,
|
"PrebuiltAppFooPriv.apk": nil,
|
||||||
"apex_manifest.json": nil,
|
"apex_manifest.json": nil,
|
||||||
"AndroidManifest.xml": nil,
|
"AndroidManifest.xml": nil,
|
||||||
"system/sepolicy/apex/myapex-file_contexts": nil,
|
|
||||||
"system/sepolicy/apex/myapex.updatable-file_contexts": nil,
|
"system/sepolicy/apex/myapex.updatable-file_contexts": nil,
|
||||||
"system/sepolicy/apex/myapex2-file_contexts": nil,
|
"system/sepolicy/apex/myapex2-file_contexts": nil,
|
||||||
"system/sepolicy/apex/otherapex-file_contexts": nil,
|
"system/sepolicy/apex/otherapex-file_contexts": nil,
|
||||||
@@ -204,6 +204,10 @@ var apexFixtureFactory = android.NewFixtureFactory(
|
|||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var prepareForTestWithMyapex = android.FixtureMergeMockFs(android.MockFS{
|
||||||
|
"system/sepolicy/apex/myapex-file_contexts": nil,
|
||||||
|
})
|
||||||
|
|
||||||
func setUp() {
|
func setUp() {
|
||||||
var err error
|
var err error
|
||||||
buildDir, err = ioutil.TempDir("", "soong_apex_test")
|
buildDir, err = ioutil.TempDir("", "soong_apex_test")
|
||||||
|
@@ -26,23 +26,32 @@ import (
|
|||||||
// Contains tests for boot_image logic from java/boot_image.go as the ART boot image requires
|
// Contains tests for boot_image logic from java/boot_image.go as the ART boot image requires
|
||||||
// modules from the ART apex.
|
// modules from the ART apex.
|
||||||
|
|
||||||
|
var prepareForTestWithBootImage = android.GroupFixturePreparers(
|
||||||
|
java.PrepareForTestWithDexpreopt,
|
||||||
|
PrepareForTestWithApexBuildComponents,
|
||||||
|
)
|
||||||
|
|
||||||
|
// Some additional files needed for the art apex.
|
||||||
|
var prepareForTestWithArtApex = android.FixtureMergeMockFs(android.MockFS{
|
||||||
|
"com.android.art.avbpubkey": nil,
|
||||||
|
"com.android.art.pem": nil,
|
||||||
|
"system/sepolicy/apex/com.android.art-file_contexts": nil,
|
||||||
|
})
|
||||||
|
|
||||||
func TestBootImages(t *testing.T) {
|
func TestBootImages(t *testing.T) {
|
||||||
result := apexFixtureFactory.Extend(
|
result := android.GroupFixturePreparers(
|
||||||
|
prepareForTestWithBootImage,
|
||||||
// Configure some libraries in the art and framework boot images.
|
// Configure some libraries in the art and framework boot images.
|
||||||
dexpreopt.FixtureSetArtBootJars("com.android.art:baz", "com.android.art:quuz"),
|
dexpreopt.FixtureSetArtBootJars("com.android.art:baz", "com.android.art:quuz"),
|
||||||
dexpreopt.FixtureSetBootJars("platform:foo", "platform:bar"),
|
dexpreopt.FixtureSetBootJars("platform:foo", "platform:bar"),
|
||||||
filesForSdkLibrary.AddToFixture(),
|
prepareForTestWithArtApex,
|
||||||
// Some additional files needed for the art apex.
|
|
||||||
android.FixtureMergeMockFs(android.MockFS{
|
java.PrepareForTestWithJavaSdkLibraryFiles,
|
||||||
"com.android.art.avbpubkey": nil,
|
java.FixtureWithLastReleaseApis("foo"),
|
||||||
"com.android.art.pem": nil,
|
|
||||||
"system/sepolicy/apex/com.android.art-file_contexts": nil,
|
|
||||||
}),
|
|
||||||
).RunTestWithBp(t, `
|
).RunTestWithBp(t, `
|
||||||
java_sdk_library {
|
java_sdk_library {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
srcs: ["b.java"],
|
srcs: ["b.java"],
|
||||||
unsafe_ignore_missing_latest_api: true,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
java_library {
|
java_library {
|
||||||
@@ -152,7 +161,9 @@ func checkBootImage(t *testing.T, result *android.TestResult, moduleName string,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestBootImageInApex(t *testing.T) {
|
func TestBootImageInApex(t *testing.T) {
|
||||||
result := apexFixtureFactory.Extend(
|
result := android.GroupFixturePreparers(
|
||||||
|
prepareForTestWithBootImage,
|
||||||
|
prepareForTestWithMyapex,
|
||||||
// Configure some libraries in the framework boot image.
|
// Configure some libraries in the framework boot image.
|
||||||
dexpreopt.FixtureSetBootJars("platform:foo", "platform:bar"),
|
dexpreopt.FixtureSetBootJars("platform:foo", "platform:bar"),
|
||||||
).RunTestWithBp(t, `
|
).RunTestWithBp(t, `
|
||||||
|
Reference in New Issue
Block a user