|
@@ -115,20 +115,7 @@ func TestBootclasspathFragments(t *testing.T) {
|
|
|
|
|
|
// Make sure that the art-bootclasspath-fragment is using the correct configuration.
|
|
|
checkBootclasspathFragment(t, result, "art-bootclasspath-fragment", "android_common_apex10000",
|
|
|
- "com.android.art:baz,com.android.art:quuz", `
|
|
|
-dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.art
|
|
|
-dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.oat
|
|
|
-dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.vdex
|
|
|
-dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-quuz.art
|
|
|
-dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-quuz.oat
|
|
|
-dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-quuz.vdex
|
|
|
-dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.art
|
|
|
-dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.oat
|
|
|
-dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.vdex
|
|
|
-dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-quuz.art
|
|
|
-dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-quuz.oat
|
|
|
-dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-quuz.vdex
|
|
|
-`)
|
|
|
+ "com.android.art:baz,com.android.art:quuz")
|
|
|
}
|
|
|
|
|
|
func TestBootclasspathFragments_FragmentDependency(t *testing.T) {
|
|
@@ -261,7 +248,7 @@ func TestBootclasspathFragments_FragmentDependency(t *testing.T) {
|
|
|
checkAPIScopeStubs("other", otherInfo, java.CorePlatformHiddenAPIScope)
|
|
|
}
|
|
|
|
|
|
-func checkBootclasspathFragment(t *testing.T, result *android.TestResult, moduleName, variantName string, expectedConfiguredModules string, expectedBootclasspathFragmentFiles string) {
|
|
|
+func checkBootclasspathFragment(t *testing.T, result *android.TestResult, moduleName, variantName string, expectedConfiguredModules string) {
|
|
|
t.Helper()
|
|
|
|
|
|
bootclasspathFragment := result.ModuleForTests(moduleName, variantName).Module().(*java.BootclasspathFragmentModule)
|
|
@@ -269,19 +256,6 @@ func checkBootclasspathFragment(t *testing.T, result *android.TestResult, module
|
|
|
bootclasspathFragmentInfo := result.ModuleProvider(bootclasspathFragment, java.BootclasspathFragmentApexContentInfoProvider).(java.BootclasspathFragmentApexContentInfo)
|
|
|
modules := bootclasspathFragmentInfo.Modules()
|
|
|
android.AssertStringEquals(t, "invalid modules for "+moduleName, expectedConfiguredModules, modules.String())
|
|
|
-
|
|
|
- // Get a list of all the paths in the boot image sorted by arch type.
|
|
|
- allPaths := []string{}
|
|
|
- bootImageFilesByArchType := bootclasspathFragmentInfo.AndroidBootImageFilesByArchType()
|
|
|
- for _, archType := range android.ArchTypeList() {
|
|
|
- if paths, ok := bootImageFilesByArchType[archType]; ok {
|
|
|
- for _, path := range paths {
|
|
|
- allPaths = append(allPaths, android.NormalizePathForTesting(path))
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- android.AssertTrimmedStringEquals(t, "invalid paths for "+moduleName, expectedBootclasspathFragmentFiles, strings.Join(allPaths, "\n"))
|
|
|
}
|
|
|
|
|
|
func TestBootclasspathFragmentInArtApex(t *testing.T) {
|
|
@@ -420,18 +394,6 @@ func TestBootclasspathFragmentInArtApex(t *testing.T) {
|
|
|
ensureExactContents(t, result.TestContext, "com.android.art", "android_common_com.android.art_image", []string{
|
|
|
"etc/boot-image.prof",
|
|
|
"etc/classpaths/bootclasspath.pb",
|
|
|
- "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/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/bar.jar",
|
|
|
"javalib/foo.jar",
|
|
|
})
|
|
@@ -441,62 +403,12 @@ func TestBootclasspathFragmentInArtApex(t *testing.T) {
|
|
|
`mybootclasspathfragment`,
|
|
|
})
|
|
|
|
|
|
- // The boot images are installed in the APEX by Soong, so there shouldn't be any dexpreopt-related Make modules.
|
|
|
- ensureDoesNotContainRequiredDeps(t, result.TestContext, "com.android.art", "android_common_com.android.art_image", []string{
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot.art",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot.oat",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot.vdex",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot-bar.art",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot-bar.oat",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot-bar.vdex",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot.art",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot.oat",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot.vdex",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot-bar.art",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot-bar.oat",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot-bar.vdex",
|
|
|
- })
|
|
|
-
|
|
|
// 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")
|
|
|
checkCopiesToPredefinedLocationForArt(t, result.Config, module, "bar", "foo")
|
|
|
})
|
|
|
|
|
|
- t.Run("boot image files from source no boot image in apex", func(t *testing.T) {
|
|
|
- result := android.GroupFixturePreparers(
|
|
|
- commonPreparer,
|
|
|
-
|
|
|
- // Configure some libraries in the art bootclasspath_fragment that match the source
|
|
|
- // bootclasspath_fragment's contents property.
|
|
|
- java.FixtureConfigureBootJars("com.android.art:foo", "com.android.art:bar"),
|
|
|
- addSource("foo", "bar"),
|
|
|
- java.FixtureSetBootImageInstallDirOnDevice("art", "system/framework"),
|
|
|
- ).RunTest(t)
|
|
|
-
|
|
|
- ensureExactContents(t, result.TestContext, "com.android.art", "android_common_com.android.art_image", []string{
|
|
|
- "etc/boot-image.prof",
|
|
|
- "etc/classpaths/bootclasspath.pb",
|
|
|
- "javalib/bar.jar",
|
|
|
- "javalib/foo.jar",
|
|
|
- })
|
|
|
-
|
|
|
- ensureContainsRequiredDeps(t, result.TestContext, "com.android.art", "android_common_com.android.art_image", []string{
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot.art",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot.oat",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot.vdex",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot-bar.art",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot-bar.oat",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot-bar.vdex",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot.art",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot.oat",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot.vdex",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot-bar.art",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot-bar.oat",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot-bar.vdex",
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
t.Run("generate boot image profile even if dexpreopt is disabled", func(t *testing.T) {
|
|
|
result := android.GroupFixturePreparers(
|
|
|
commonPreparer,
|
|
@@ -552,18 +464,6 @@ func TestBootclasspathFragmentInArtApex(t *testing.T) {
|
|
|
|
|
|
ensureExactDeapexedContents(t, result.TestContext, "com.android.art", "android_common", []string{
|
|
|
"etc/boot-image.prof",
|
|
|
- "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/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/bar.jar",
|
|
|
"javalib/foo.jar",
|
|
|
})
|
|
@@ -574,65 +474,12 @@ func TestBootclasspathFragmentInArtApex(t *testing.T) {
|
|
|
`prebuilt_com.android.art`,
|
|
|
})
|
|
|
|
|
|
- // The boot images are installed in the APEX by Soong, so there shouldn't be any dexpreopt-related Make modules.
|
|
|
- ensureDoesNotContainRequiredDeps(t, result.TestContext, "com.android.art", "android_common_com.android.art_image", []string{
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot.art",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot.oat",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot.vdex",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot-bar.art",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot-bar.oat",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot-bar.vdex",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot.art",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot.oat",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot.vdex",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot-bar.art",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot-bar.oat",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot-bar.vdex",
|
|
|
- })
|
|
|
-
|
|
|
// 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")
|
|
|
checkCopiesToPredefinedLocationForArt(t, result.Config, module, "bar", "foo")
|
|
|
})
|
|
|
|
|
|
- t.Run("boot image files from preferred prebuilt no boot image in apex", func(t *testing.T) {
|
|
|
- result := android.GroupFixturePreparers(
|
|
|
- commonPreparer,
|
|
|
-
|
|
|
- // Configure some libraries in the art bootclasspath_fragment that match the source
|
|
|
- // bootclasspath_fragment's contents property.
|
|
|
- java.FixtureConfigureBootJars("com.android.art:foo", "com.android.art:bar"),
|
|
|
- addSource("foo", "bar"),
|
|
|
-
|
|
|
- // Make sure that a preferred prebuilt with consistent contents doesn't affect the apex.
|
|
|
- addPrebuilt(true, "foo", "bar"),
|
|
|
-
|
|
|
- java.FixtureSetBootImageInstallDirOnDevice("art", "system/framework"),
|
|
|
- ).RunTest(t)
|
|
|
-
|
|
|
- ensureExactDeapexedContents(t, result.TestContext, "com.android.art", "android_common", []string{
|
|
|
- "etc/boot-image.prof",
|
|
|
- "javalib/bar.jar",
|
|
|
- "javalib/foo.jar",
|
|
|
- })
|
|
|
-
|
|
|
- ensureContainsRequiredDeps(t, result.TestContext, "com.android.art", "android_common_com.android.art_image", []string{
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot.art",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot.oat",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot.vdex",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot-bar.art",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot-bar.oat",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm64-boot-bar.vdex",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot.art",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot.oat",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot.vdex",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot-bar.art",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot-bar.oat",
|
|
|
- "mybootclasspathfragment-dexpreopt-arm-boot-bar.vdex",
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
t.Run("source with inconsistency between config and contents", func(t *testing.T) {
|
|
|
android.GroupFixturePreparers(
|
|
|
commonPreparer,
|
|
@@ -782,10 +629,6 @@ func TestBootclasspathFragmentInPrebuiltArtApex(t *testing.T) {
|
|
|
|
|
|
module := result.ModuleForTests("mybootclasspathfragment", "android_common_com.android.art")
|
|
|
checkCopiesToPredefinedLocationForArt(t, result.Config, module, "bar", "foo")
|
|
|
-
|
|
|
- // Check that the right deapexer module was chosen for a boot image.
|
|
|
- param := module.Output("out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.art")
|
|
|
- android.AssertStringDoesContain(t, "didn't find the expected deapexer in the input path", param.Input.String(), "/com.android.art.deapexer")
|
|
|
})
|
|
|
|
|
|
t.Run("enabled alternative APEX", func(t *testing.T) {
|