Fix some tests for dexpreopt and remove unnecessary tests.
This CL is to prepare for the changes in http://r.android.com/2652081. See the description of that CL for the reasons. Some tests were set up in a fragile way and were easy to be broken when the implementation changes. This CL is a pure test change that fixes them. This CL also removes TestNoUpdatableJarsInBootImage. That test checks what should go to the ART boot image and what should go to the platform one, which does not apply today because boot images are not associated with mainline modules anymore: a boot image may take jars from multiple mainline modules and the platform, and a mainline module can contribute to multiple boot images. In practice, we have ART jars in the platform boot image, and we are going to add core-icu4j and consrypt to the ART boot image, which is now for testing only. Bug: 290583827 Test: m nothing Change-Id: I22c45cbf6f853b030b68edb51197854e9c53a02e
This commit is contained in:
@@ -268,10 +268,10 @@ func TestBootclasspathFragmentInArtApex(t *testing.T) {
|
||||
name: "com.android.art",
|
||||
key: "com.android.art.key",
|
||||
bootclasspath_fragments: [
|
||||
"mybootclasspathfragment",
|
||||
"art-bootclasspath-fragment",
|
||||
],
|
||||
// bar (like foo) should be transitively included in this apex because it is part of the
|
||||
// mybootclasspathfragment bootclasspath_fragment.
|
||||
// art-bootclasspath-fragment bootclasspath_fragment.
|
||||
updatable: false,
|
||||
}
|
||||
|
||||
@@ -280,42 +280,6 @@ func TestBootclasspathFragmentInArtApex(t *testing.T) {
|
||||
public_key: "testkey.avbpubkey",
|
||||
private_key: "testkey.pem",
|
||||
}
|
||||
|
||||
java_library {
|
||||
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",
|
||||
],
|
||||
}
|
||||
|
||||
java_import {
|
||||
name: "foo",
|
||||
jars: ["foo.jar"],
|
||||
apex_available: [
|
||||
"com.android.art",
|
||||
],
|
||||
compile_dex: true,
|
||||
}
|
||||
|
||||
java_import {
|
||||
name: "bar",
|
||||
jars: ["bar.jar"],
|
||||
apex_available: [
|
||||
"com.android.art",
|
||||
],
|
||||
compile_dex: true,
|
||||
}
|
||||
`),
|
||||
)
|
||||
|
||||
@@ -330,7 +294,7 @@ func TestBootclasspathFragmentInArtApex(t *testing.T) {
|
||||
addSource := func(contents ...string) android.FixturePreparer {
|
||||
text := fmt.Sprintf(`
|
||||
bootclasspath_fragment {
|
||||
name: "mybootclasspathfragment",
|
||||
name: "art-bootclasspath-fragment",
|
||||
image_name: "art",
|
||||
%s
|
||||
apex_available: [
|
||||
@@ -342,6 +306,19 @@ func TestBootclasspathFragmentInArtApex(t *testing.T) {
|
||||
}
|
||||
`, contentsInsert(contents))
|
||||
|
||||
for _, content := range contents {
|
||||
text += fmt.Sprintf(`
|
||||
java_library {
|
||||
name: "%[1]s",
|
||||
srcs: ["%[1]s.java"],
|
||||
installable: true,
|
||||
apex_available: [
|
||||
"com.android.art",
|
||||
],
|
||||
}
|
||||
`, content)
|
||||
}
|
||||
|
||||
return android.FixtureAddTextFile("art/build/boot/Android.bp", text)
|
||||
}
|
||||
|
||||
@@ -357,11 +334,11 @@ func TestBootclasspathFragmentInArtApex(t *testing.T) {
|
||||
src: "com.android.art-arm.apex",
|
||||
},
|
||||
},
|
||||
exported_bootclasspath_fragments: ["mybootclasspathfragment"],
|
||||
exported_bootclasspath_fragments: ["art-bootclasspath-fragment"],
|
||||
}
|
||||
|
||||
prebuilt_bootclasspath_fragment {
|
||||
name: "mybootclasspathfragment",
|
||||
name: "art-bootclasspath-fragment",
|
||||
image_name: "art",
|
||||
%s
|
||||
prefer: %t,
|
||||
@@ -369,14 +346,29 @@ func TestBootclasspathFragmentInArtApex(t *testing.T) {
|
||||
"com.android.art",
|
||||
],
|
||||
hidden_api: {
|
||||
annotation_flags: "mybootclasspathfragment/annotation-flags.csv",
|
||||
metadata: "mybootclasspathfragment/metadata.csv",
|
||||
index: "mybootclasspathfragment/index.csv",
|
||||
stub_flags: "mybootclasspathfragment/stub-flags.csv",
|
||||
all_flags: "mybootclasspathfragment/all-flags.csv",
|
||||
annotation_flags: "hiddenapi/annotation-flags.csv",
|
||||
metadata: "hiddenapi/metadata.csv",
|
||||
index: "hiddenapi/index.csv",
|
||||
stub_flags: "hiddenapi/stub-flags.csv",
|
||||
all_flags: "hiddenapi/all-flags.csv",
|
||||
},
|
||||
}
|
||||
`, contentsInsert(contents), prefer)
|
||||
|
||||
for _, content := range contents {
|
||||
text += fmt.Sprintf(`
|
||||
java_import {
|
||||
name: "%[1]s",
|
||||
prefer: %[2]t,
|
||||
jars: ["%[1]s.jar"],
|
||||
apex_available: [
|
||||
"com.android.art",
|
||||
],
|
||||
compile_dex: true,
|
||||
}
|
||||
`, content, prefer)
|
||||
}
|
||||
|
||||
return android.FixtureAddTextFile("prebuilts/module_sdk/art/Android.bp", text)
|
||||
}
|
||||
|
||||
@@ -399,13 +391,13 @@ func TestBootclasspathFragmentInArtApex(t *testing.T) {
|
||||
})
|
||||
|
||||
java.CheckModuleDependencies(t, result.TestContext, "com.android.art", "android_common_com.android.art_image", []string{
|
||||
`art-bootclasspath-fragment`,
|
||||
`com.android.art.key`,
|
||||
`mybootclasspathfragment`,
|
||||
})
|
||||
|
||||
// Make sure that the source bootclasspath_fragment copies its dex files to the predefined
|
||||
// locations for the art image.
|
||||
module := result.ModuleForTests("mybootclasspathfragment", "android_common_apex10000")
|
||||
module := result.ModuleForTests("art-bootclasspath-fragment", "android_common_apex10000")
|
||||
checkCopiesToPredefinedLocationForArt(t, result.Config, module, "bar", "foo")
|
||||
})
|
||||
|
||||
@@ -469,14 +461,14 @@ func TestBootclasspathFragmentInArtApex(t *testing.T) {
|
||||
})
|
||||
|
||||
java.CheckModuleDependencies(t, result.TestContext, "com.android.art", "android_common_com.android.art_image", []string{
|
||||
`art-bootclasspath-fragment`,
|
||||
`com.android.art.key`,
|
||||
`mybootclasspathfragment`,
|
||||
`prebuilt_com.android.art`,
|
||||
})
|
||||
|
||||
// Make sure that the prebuilt bootclasspath_fragment copies its dex files to the predefined
|
||||
// locations for the art image.
|
||||
module := result.ModuleForTests("prebuilt_mybootclasspathfragment", "android_common_com.android.art")
|
||||
module := result.ModuleForTests("prebuilt_art-bootclasspath-fragment", "android_common_com.android.art")
|
||||
checkCopiesToPredefinedLocationForArt(t, result.Config, module, "bar", "foo")
|
||||
})
|
||||
|
||||
@@ -566,7 +558,7 @@ func TestBootclasspathFragmentInPrebuiltArtApex(t *testing.T) {
|
||||
src: "com.android.art-arm.apex",
|
||||
},
|
||||
},
|
||||
exported_bootclasspath_fragments: ["mybootclasspathfragment"],
|
||||
exported_bootclasspath_fragments: ["art-bootclasspath-fragment"],
|
||||
}
|
||||
|
||||
java_import {
|
||||
@@ -586,7 +578,7 @@ func TestBootclasspathFragmentInPrebuiltArtApex(t *testing.T) {
|
||||
}
|
||||
|
||||
prebuilt_bootclasspath_fragment {
|
||||
name: "mybootclasspathfragment",
|
||||
name: "art-bootclasspath-fragment",
|
||||
image_name: "art",
|
||||
// Must match the "com.android.art:" entries passed to FixtureConfigureBootJars above.
|
||||
contents: ["foo", "bar"],
|
||||
@@ -594,11 +586,11 @@ func TestBootclasspathFragmentInPrebuiltArtApex(t *testing.T) {
|
||||
"com.android.art",
|
||||
],
|
||||
hidden_api: {
|
||||
annotation_flags: "mybootclasspathfragment/annotation-flags.csv",
|
||||
metadata: "mybootclasspathfragment/metadata.csv",
|
||||
index: "mybootclasspathfragment/index.csv",
|
||||
stub_flags: "mybootclasspathfragment/stub-flags.csv",
|
||||
all_flags: "mybootclasspathfragment/all-flags.csv",
|
||||
annotation_flags: "hiddenapi/annotation-flags.csv",
|
||||
metadata: "hiddenapi/metadata.csv",
|
||||
index: "hiddenapi/index.csv",
|
||||
stub_flags: "hiddenapi/stub-flags.csv",
|
||||
all_flags: "hiddenapi/all-flags.csv",
|
||||
},
|
||||
}
|
||||
|
||||
@@ -608,7 +600,7 @@ func TestBootclasspathFragmentInPrebuiltArtApex(t *testing.T) {
|
||||
apex_name: "com.android.art",
|
||||
%s
|
||||
src: "com.mycompany.android.art.apex",
|
||||
exported_bootclasspath_fragments: ["mybootclasspathfragment"],
|
||||
exported_bootclasspath_fragments: ["art-bootclasspath-fragment"],
|
||||
}
|
||||
`
|
||||
|
||||
@@ -617,17 +609,17 @@ func TestBootclasspathFragmentInPrebuiltArtApex(t *testing.T) {
|
||||
|
||||
java.CheckModuleDependencies(t, result.TestContext, "com.android.art", "android_common_com.android.art", []string{
|
||||
`com.android.art.apex.selector`,
|
||||
`prebuilt_mybootclasspathfragment`,
|
||||
`prebuilt_art-bootclasspath-fragment`,
|
||||
})
|
||||
|
||||
java.CheckModuleDependencies(t, result.TestContext, "mybootclasspathfragment", "android_common_com.android.art", []string{
|
||||
java.CheckModuleDependencies(t, result.TestContext, "art-bootclasspath-fragment", "android_common_com.android.art", []string{
|
||||
`com.android.art.deapexer`,
|
||||
`dex2oatd`,
|
||||
`prebuilt_bar`,
|
||||
`prebuilt_foo`,
|
||||
})
|
||||
|
||||
module := result.ModuleForTests("mybootclasspathfragment", "android_common_com.android.art")
|
||||
module := result.ModuleForTests("art-bootclasspath-fragment", "android_common_com.android.art")
|
||||
checkCopiesToPredefinedLocationForArt(t, result.Config, module, "bar", "foo")
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user