Merge "Fix tests to use correct fixtures for configuring (Apex)BootJars."
This commit is contained in:
@@ -4663,6 +4663,7 @@ func TestPrebuiltApexNameWithPlatformBootclasspath(t *testing.T) {
|
|||||||
|
|
||||||
prebuilt_bootclasspath_fragment {
|
prebuilt_bootclasspath_fragment {
|
||||||
name: "art-bootclasspath-fragment",
|
name: "art-bootclasspath-fragment",
|
||||||
|
image_name: "art",
|
||||||
contents: ["core-oj"],
|
contents: ["core-oj"],
|
||||||
hidden_api: {
|
hidden_api: {
|
||||||
annotation_flags: "my-bootclasspath-fragment/annotation-flags.csv",
|
annotation_flags: "my-bootclasspath-fragment/annotation-flags.csv",
|
||||||
@@ -4871,7 +4872,7 @@ func TestPrebuiltExportDexImplementationJars(t *testing.T) {
|
|||||||
|
|
||||||
func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
||||||
preparer := android.GroupFixturePreparers(
|
preparer := android.GroupFixturePreparers(
|
||||||
java.FixtureConfigureBootJars("myapex:libfoo", "myapex:libbar"),
|
java.FixtureConfigureApexBootJars("myapex:libfoo", "myapex:libbar"),
|
||||||
// Make sure that the frameworks/base/Android.bp file exists as otherwise hidden API encoding
|
// Make sure that the frameworks/base/Android.bp file exists as otherwise hidden API encoding
|
||||||
// is disabled.
|
// is disabled.
|
||||||
android.FixtureAddTextFile("frameworks/base/Android.bp", ""),
|
android.FixtureAddTextFile("frameworks/base/Android.bp", ""),
|
||||||
@@ -4949,6 +4950,7 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
|||||||
name: "libfoo",
|
name: "libfoo",
|
||||||
jars: ["libfoo.jar"],
|
jars: ["libfoo.jar"],
|
||||||
apex_available: ["myapex"],
|
apex_available: ["myapex"],
|
||||||
|
permitted_packages: ["foo"],
|
||||||
}
|
}
|
||||||
|
|
||||||
java_sdk_library_import {
|
java_sdk_library_import {
|
||||||
@@ -4958,6 +4960,7 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
|||||||
},
|
},
|
||||||
apex_available: ["myapex"],
|
apex_available: ["myapex"],
|
||||||
shared_library: false,
|
shared_library: false,
|
||||||
|
permitted_packages: ["bar"],
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
@@ -4998,6 +5001,7 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
|||||||
name: "libfoo",
|
name: "libfoo",
|
||||||
jars: ["libfoo.jar"],
|
jars: ["libfoo.jar"],
|
||||||
apex_available: ["myapex"],
|
apex_available: ["myapex"],
|
||||||
|
permitted_packages: ["foo"],
|
||||||
}
|
}
|
||||||
|
|
||||||
java_sdk_library_import {
|
java_sdk_library_import {
|
||||||
@@ -5007,6 +5011,7 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
|||||||
},
|
},
|
||||||
apex_available: ["myapex"],
|
apex_available: ["myapex"],
|
||||||
shared_library: false,
|
shared_library: false,
|
||||||
|
permitted_packages: ["bar"],
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
@@ -5120,6 +5125,7 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
|||||||
prefer: true,
|
prefer: true,
|
||||||
jars: ["libfoo.jar"],
|
jars: ["libfoo.jar"],
|
||||||
apex_available: ["myapex"],
|
apex_available: ["myapex"],
|
||||||
|
permitted_packages: ["foo"],
|
||||||
}
|
}
|
||||||
|
|
||||||
java_library {
|
java_library {
|
||||||
@@ -5136,6 +5142,7 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
|||||||
},
|
},
|
||||||
apex_available: ["myapex"],
|
apex_available: ["myapex"],
|
||||||
shared_library: false,
|
shared_library: false,
|
||||||
|
permitted_packages: ["bar"],
|
||||||
}
|
}
|
||||||
|
|
||||||
java_sdk_library {
|
java_sdk_library {
|
||||||
@@ -5209,6 +5216,7 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
|||||||
name: "libfoo",
|
name: "libfoo",
|
||||||
srcs: ["foo/bar/MyClass.java"],
|
srcs: ["foo/bar/MyClass.java"],
|
||||||
apex_available: ["myapex"],
|
apex_available: ["myapex"],
|
||||||
|
permitted_packages: ["foo"],
|
||||||
}
|
}
|
||||||
|
|
||||||
java_sdk_library_import {
|
java_sdk_library_import {
|
||||||
@@ -5225,6 +5233,7 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
|||||||
srcs: ["foo/bar/MyClass.java"],
|
srcs: ["foo/bar/MyClass.java"],
|
||||||
unsafe_ignore_missing_latest_api: true,
|
unsafe_ignore_missing_latest_api: true,
|
||||||
apex_available: ["myapex"],
|
apex_available: ["myapex"],
|
||||||
|
permitted_packages: ["bar"],
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
@@ -5286,6 +5295,7 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
|||||||
prefer: true,
|
prefer: true,
|
||||||
jars: ["libfoo.jar"],
|
jars: ["libfoo.jar"],
|
||||||
apex_available: ["myapex"],
|
apex_available: ["myapex"],
|
||||||
|
permitted_packages: ["foo"],
|
||||||
}
|
}
|
||||||
|
|
||||||
java_library {
|
java_library {
|
||||||
@@ -5302,6 +5312,7 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
|||||||
},
|
},
|
||||||
apex_available: ["myapex"],
|
apex_available: ["myapex"],
|
||||||
shared_library: false,
|
shared_library: false,
|
||||||
|
permitted_packages: ["bar"],
|
||||||
}
|
}
|
||||||
|
|
||||||
java_sdk_library {
|
java_sdk_library {
|
||||||
@@ -6899,6 +6910,7 @@ func testNoUpdatableJarsInBootImage(t *testing.T, errmsg string, preparer androi
|
|||||||
apex_available: [
|
apex_available: [
|
||||||
"some-updatable-apex",
|
"some-updatable-apex",
|
||||||
],
|
],
|
||||||
|
permitted_packages: ["some.updatable.apex.lib"],
|
||||||
}
|
}
|
||||||
|
|
||||||
java_library {
|
java_library {
|
||||||
@@ -6908,6 +6920,7 @@ func testNoUpdatableJarsInBootImage(t *testing.T, errmsg string, preparer androi
|
|||||||
"some-non-updatable-apex",
|
"some-non-updatable-apex",
|
||||||
],
|
],
|
||||||
compile_dex: true,
|
compile_dex: true,
|
||||||
|
permitted_packages: ["some.non.updatable.apex.lib"],
|
||||||
}
|
}
|
||||||
|
|
||||||
bootclasspath_fragment {
|
bootclasspath_fragment {
|
||||||
@@ -7118,7 +7131,9 @@ func TestUpdatable_should_not_set_generate_classpaths_proto(t *testing.T) {
|
|||||||
"myapex",
|
"myapex",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
`)
|
`,
|
||||||
|
dexpreopt.FixtureSetApexSystemServerJars("myapex:foo"),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestNoUpdatableJarsInBootImage(t *testing.T) {
|
func TestNoUpdatableJarsInBootImage(t *testing.T) {
|
||||||
@@ -7148,18 +7163,30 @@ func TestNoUpdatableJarsInBootImage(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
t.Run("updatable jar from ART apex in the ART boot image => ok", func(t *testing.T) {
|
t.Run("updatable jar from ART apex in the ART boot image => ok", func(t *testing.T) {
|
||||||
preparer := java.FixtureConfigureBootJars("com.android.art.debug:some-art-lib")
|
preparer := android.GroupFixturePreparers(
|
||||||
fragment := java.ApexVariantReference{
|
java.FixtureConfigureBootJars("com.android.art.debug:some-art-lib"),
|
||||||
Apex: proptools.StringPtr("com.android.art.debug"),
|
java.FixtureConfigureApexBootJars("some-non-updatable-apex:some-non-updatable-apex-lib"),
|
||||||
Module: proptools.StringPtr("art-bootclasspath-fragment"),
|
)
|
||||||
|
fragments := []java.ApexVariantReference{
|
||||||
|
{
|
||||||
|
Apex: proptools.StringPtr("com.android.art.debug"),
|
||||||
|
Module: proptools.StringPtr("art-bootclasspath-fragment"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Apex: proptools.StringPtr("some-non-updatable-apex"),
|
||||||
|
Module: proptools.StringPtr("some-non-updatable-fragment"),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
testNoUpdatableJarsInBootImage(t, "", preparer, fragment)
|
testNoUpdatableJarsInBootImage(t, "", preparer, fragments...)
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("updatable jar from ART apex in the framework boot image => error", func(t *testing.T) {
|
t.Run("updatable jar from ART apex in the framework boot image => error", func(t *testing.T) {
|
||||||
err := `module "some-art-lib" from updatable apexes \["com.android.art.debug"\] is not allowed in the framework boot image`
|
err := `module "some-art-lib" from updatable apexes \["com.android.art.debug"\] is not allowed in the framework boot image`
|
||||||
// Update the dexpreopt BootJars directly.
|
// Update the dexpreopt BootJars directly.
|
||||||
preparer := prepareSetBootJars("com.android.art.debug:some-art-lib")
|
preparer := android.GroupFixturePreparers(
|
||||||
|
prepareSetBootJars("com.android.art.debug:some-art-lib"),
|
||||||
|
java.FixtureConfigureApexBootJars("some-non-updatable-apex:some-non-updatable-apex-lib"),
|
||||||
|
)
|
||||||
testNoUpdatableJarsInBootImage(t, err, preparer)
|
testNoUpdatableJarsInBootImage(t, err, preparer)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -7179,12 +7206,15 @@ func TestNoUpdatableJarsInBootImage(t *testing.T) {
|
|||||||
|
|
||||||
t.Run("updatable jar from some other apex in the framework boot image => error", func(t *testing.T) {
|
t.Run("updatable jar from some other apex in the framework boot image => error", func(t *testing.T) {
|
||||||
err := `module "some-updatable-apex-lib" from updatable apexes \["some-updatable-apex"\] is not allowed in the framework boot image`
|
err := `module "some-updatable-apex-lib" from updatable apexes \["some-updatable-apex"\] is not allowed in the framework boot image`
|
||||||
preparer := java.FixtureConfigureBootJars("some-updatable-apex:some-updatable-apex-lib")
|
preparer := android.GroupFixturePreparers(
|
||||||
|
java.FixtureConfigureBootJars("some-updatable-apex:some-updatable-apex-lib"),
|
||||||
|
java.FixtureConfigureApexBootJars("some-non-updatable-apex:some-non-updatable-apex-lib"),
|
||||||
|
)
|
||||||
testNoUpdatableJarsInBootImage(t, err, preparer)
|
testNoUpdatableJarsInBootImage(t, err, preparer)
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("non-updatable jar from some other apex in the framework boot image => ok", func(t *testing.T) {
|
t.Run("non-updatable jar from some other apex in the framework boot image => ok", func(t *testing.T) {
|
||||||
preparer := java.FixtureConfigureBootJars("some-non-updatable-apex:some-non-updatable-apex-lib")
|
preparer := java.FixtureConfigureApexBootJars("some-non-updatable-apex:some-non-updatable-apex-lib")
|
||||||
fragment := java.ApexVariantReference{
|
fragment := java.ApexVariantReference{
|
||||||
Apex: proptools.StringPtr("some-non-updatable-apex"),
|
Apex: proptools.StringPtr("some-non-updatable-apex"),
|
||||||
Module: proptools.StringPtr("some-non-updatable-fragment"),
|
Module: proptools.StringPtr("some-non-updatable-fragment"),
|
||||||
@@ -7212,13 +7242,22 @@ func TestNoUpdatableJarsInBootImage(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
t.Run("platform jar in the framework boot image => ok", func(t *testing.T) {
|
t.Run("platform jar in the framework boot image => ok", func(t *testing.T) {
|
||||||
preparer := java.FixtureConfigureBootJars("platform:some-platform-lib")
|
preparer := android.GroupFixturePreparers(
|
||||||
testNoUpdatableJarsInBootImage(t, "", preparer)
|
java.FixtureConfigureBootJars("platform:some-platform-lib"),
|
||||||
|
java.FixtureConfigureApexBootJars("some-non-updatable-apex:some-non-updatable-apex-lib"),
|
||||||
|
)
|
||||||
|
fragments := []java.ApexVariantReference{
|
||||||
|
{
|
||||||
|
Apex: proptools.StringPtr("some-non-updatable-apex"),
|
||||||
|
Module: proptools.StringPtr("some-non-updatable-fragment"),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
testNoUpdatableJarsInBootImage(t, "", preparer, fragments...)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDexpreoptAccessDexFilesFromPrebuiltApex(t *testing.T) {
|
func TestDexpreoptAccessDexFilesFromPrebuiltApex(t *testing.T) {
|
||||||
preparer := java.FixtureConfigureBootJars("myapex:libfoo")
|
preparer := java.FixtureConfigureApexBootJars("myapex:libfoo")
|
||||||
t.Run("prebuilt no source", func(t *testing.T) {
|
t.Run("prebuilt no source", func(t *testing.T) {
|
||||||
fragment := java.ApexVariantReference{
|
fragment := java.ApexVariantReference{
|
||||||
Apex: proptools.StringPtr("myapex"),
|
Apex: proptools.StringPtr("myapex"),
|
||||||
@@ -7256,6 +7295,7 @@ func TestDexpreoptAccessDexFilesFromPrebuiltApex(t *testing.T) {
|
|||||||
name: "libfoo",
|
name: "libfoo",
|
||||||
jars: ["libfoo.jar"],
|
jars: ["libfoo.jar"],
|
||||||
apex_available: ["myapex"],
|
apex_available: ["myapex"],
|
||||||
|
permitted_packages: ["libfoo"],
|
||||||
}
|
}
|
||||||
`, "", preparer, fragment)
|
`, "", preparer, fragment)
|
||||||
})
|
})
|
||||||
@@ -8168,6 +8208,8 @@ func TestApexJavaCoverage(t *testing.T) {
|
|||||||
java.PrepareForTestWithJavaDefaultModules,
|
java.PrepareForTestWithJavaDefaultModules,
|
||||||
android.PrepareForTestWithAndroidBuildComponents,
|
android.PrepareForTestWithAndroidBuildComponents,
|
||||||
android.FixtureWithRootAndroidBp(bp),
|
android.FixtureWithRootAndroidBp(bp),
|
||||||
|
dexpreopt.FixtureSetApexBootJars("myapex:mybootclasspathlib"),
|
||||||
|
dexpreopt.FixtureSetApexSystemServerJars("myapex:mysystemserverclasspathlib"),
|
||||||
android.FixtureMergeEnv(map[string]string{
|
android.FixtureMergeEnv(map[string]string{
|
||||||
"EMMA_INSTRUMENT": "true",
|
"EMMA_INSTRUMENT": "true",
|
||||||
}),
|
}),
|
||||||
|
@@ -130,7 +130,8 @@ func TestBootclasspathFragments_FragmentDependency(t *testing.T) {
|
|||||||
result := android.GroupFixturePreparers(
|
result := android.GroupFixturePreparers(
|
||||||
prepareForTestWithBootclasspathFragment,
|
prepareForTestWithBootclasspathFragment,
|
||||||
// Configure some libraries in the art bootclasspath_fragment and platform_bootclasspath.
|
// Configure some libraries in the art bootclasspath_fragment and platform_bootclasspath.
|
||||||
java.FixtureConfigureBootJars("com.android.art:baz", "com.android.art:quuz", "platform:foo", "platform:bar"),
|
java.FixtureConfigureBootJars("com.android.art:baz", "com.android.art:quuz"),
|
||||||
|
java.FixtureConfigureApexBootJars("someapex:foo", "someapex:bar"),
|
||||||
prepareForTestWithArtApex,
|
prepareForTestWithArtApex,
|
||||||
|
|
||||||
java.PrepareForTestWithJavaSdkLibraryFiles,
|
java.PrepareForTestWithJavaSdkLibraryFiles,
|
||||||
@@ -642,7 +643,7 @@ func TestBootclasspathFragmentContentsNoName(t *testing.T) {
|
|||||||
prepareForTestWithBootclasspathFragment,
|
prepareForTestWithBootclasspathFragment,
|
||||||
prepareForTestWithMyapex,
|
prepareForTestWithMyapex,
|
||||||
// Configure bootclasspath jars to ensure that hidden API encoding is performed on them.
|
// Configure bootclasspath jars to ensure that hidden API encoding is performed on them.
|
||||||
java.FixtureConfigureBootJars("myapex:foo", "myapex:bar"),
|
java.FixtureConfigureApexBootJars("myapex:foo", "myapex:bar"),
|
||||||
// Make sure that the frameworks/base/Android.bp file exists as otherwise hidden API encoding
|
// Make sure that the frameworks/base/Android.bp file exists as otherwise hidden API encoding
|
||||||
// is disabled.
|
// is disabled.
|
||||||
android.FixtureAddTextFile("frameworks/base/Android.bp", ""),
|
android.FixtureAddTextFile("frameworks/base/Android.bp", ""),
|
||||||
@@ -893,7 +894,8 @@ func TestBootclasspathFragment_AndroidNonUpdatable(t *testing.T) {
|
|||||||
prepareForTestWithArtApex,
|
prepareForTestWithArtApex,
|
||||||
prepareForTestWithMyapex,
|
prepareForTestWithMyapex,
|
||||||
// Configure bootclasspath jars to ensure that hidden API encoding is performed on them.
|
// Configure bootclasspath jars to ensure that hidden API encoding is performed on them.
|
||||||
java.FixtureConfigureBootJars("com.android.art:baz", "com.android.art:quuz", "myapex:foo", "myapex:bar"),
|
java.FixtureConfigureBootJars("com.android.art:baz", "com.android.art:quuz"),
|
||||||
|
java.FixtureConfigureApexBootJars("myapex:foo", "myapex:bar"),
|
||||||
// Make sure that the frameworks/base/Android.bp file exists as otherwise hidden API encoding
|
// Make sure that the frameworks/base/Android.bp file exists as otherwise hidden API encoding
|
||||||
// is disabled.
|
// is disabled.
|
||||||
android.FixtureAddTextFile("frameworks/base/Android.bp", ""),
|
android.FixtureAddTextFile("frameworks/base/Android.bp", ""),
|
||||||
@@ -1062,7 +1064,8 @@ func TestBootclasspathFragment_AndroidNonUpdatable_AlwaysUsePrebuiltSdks(t *test
|
|||||||
prepareForTestWithArtApex,
|
prepareForTestWithArtApex,
|
||||||
prepareForTestWithMyapex,
|
prepareForTestWithMyapex,
|
||||||
// Configure bootclasspath jars to ensure that hidden API encoding is performed on them.
|
// Configure bootclasspath jars to ensure that hidden API encoding is performed on them.
|
||||||
java.FixtureConfigureBootJars("com.android.art:baz", "com.android.art:quuz", "myapex:foo", "myapex:bar"),
|
java.FixtureConfigureBootJars("com.android.art:baz", "com.android.art:quuz"),
|
||||||
|
java.FixtureConfigureApexBootJars("myapex:foo", "myapex:bar"),
|
||||||
// Make sure that the frameworks/base/Android.bp file exists as otherwise hidden API encoding
|
// Make sure that the frameworks/base/Android.bp file exists as otherwise hidden API encoding
|
||||||
// is disabled.
|
// is disabled.
|
||||||
android.FixtureAddTextFile("frameworks/base/Android.bp", ""),
|
android.FixtureAddTextFile("frameworks/base/Android.bp", ""),
|
||||||
|
@@ -58,6 +58,7 @@ func TestCreateClasspathElements(t *testing.T) {
|
|||||||
}),
|
}),
|
||||||
java.PrepareForTestWithJavaSdkLibraryFiles,
|
java.PrepareForTestWithJavaSdkLibraryFiles,
|
||||||
java.FixtureWithLastReleaseApis("foo", "othersdklibrary"),
|
java.FixtureWithLastReleaseApis("foo", "othersdklibrary"),
|
||||||
|
java.FixtureConfigureApexBootJars("myapex:bar"),
|
||||||
android.FixtureWithRootAndroidBp(`
|
android.FixtureWithRootAndroidBp(`
|
||||||
apex {
|
apex {
|
||||||
name: "com.android.art",
|
name: "com.android.art",
|
||||||
@@ -79,6 +80,7 @@ func TestCreateClasspathElements(t *testing.T) {
|
|||||||
|
|
||||||
bootclasspath_fragment {
|
bootclasspath_fragment {
|
||||||
name: "art-bootclasspath-fragment",
|
name: "art-bootclasspath-fragment",
|
||||||
|
image_name: "art",
|
||||||
apex_available: [
|
apex_available: [
|
||||||
"com.android.art",
|
"com.android.art",
|
||||||
],
|
],
|
||||||
@@ -193,6 +195,10 @@ func TestCreateClasspathElements(t *testing.T) {
|
|||||||
apex: "com.android.art",
|
apex: "com.android.art",
|
||||||
module: "art-bootclasspath-fragment",
|
module: "art-bootclasspath-fragment",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
apex: "myapex",
|
||||||
|
module: "mybootclasspath-fragment",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
`),
|
`),
|
||||||
|
@@ -39,7 +39,7 @@ func TestPlatformBootclasspath_Fragments(t *testing.T) {
|
|||||||
prepareForTestWithMyapex,
|
prepareForTestWithMyapex,
|
||||||
java.PrepareForTestWithJavaSdkLibraryFiles,
|
java.PrepareForTestWithJavaSdkLibraryFiles,
|
||||||
java.FixtureWithLastReleaseApis("foo"),
|
java.FixtureWithLastReleaseApis("foo"),
|
||||||
java.FixtureConfigureBootJars("myapex:bar"),
|
java.FixtureConfigureApexBootJars("myapex:bar"),
|
||||||
android.FixtureWithRootAndroidBp(`
|
android.FixtureWithRootAndroidBp(`
|
||||||
platform_bootclasspath {
|
platform_bootclasspath {
|
||||||
name: "platform-bootclasspath",
|
name: "platform-bootclasspath",
|
||||||
@@ -195,6 +195,7 @@ func TestPlatformBootclasspathDependencies(t *testing.T) {
|
|||||||
|
|
||||||
bootclasspath_fragment {
|
bootclasspath_fragment {
|
||||||
name: "art-bootclasspath-fragment",
|
name: "art-bootclasspath-fragment",
|
||||||
|
image_name: "art",
|
||||||
apex_available: [
|
apex_available: [
|
||||||
"com.android.art",
|
"com.android.art",
|
||||||
],
|
],
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
package apex
|
package apex
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"android/soong/dexpreopt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"android/soong/android"
|
"android/soong/android"
|
||||||
@@ -30,6 +31,7 @@ func TestSystemserverclasspathFragmentContents(t *testing.T) {
|
|||||||
result := android.GroupFixturePreparers(
|
result := android.GroupFixturePreparers(
|
||||||
prepareForTestWithSystemserverclasspathFragment,
|
prepareForTestWithSystemserverclasspathFragment,
|
||||||
prepareForTestWithMyapex,
|
prepareForTestWithMyapex,
|
||||||
|
dexpreopt.FixtureSetApexSystemServerJars("myapex:foo"),
|
||||||
).RunTestWithBp(t, `
|
).RunTestWithBp(t, `
|
||||||
apex {
|
apex {
|
||||||
name: "myapex",
|
name: "myapex",
|
||||||
@@ -81,6 +83,7 @@ func TestSystemserverclasspathFragmentNoGeneratedProto(t *testing.T) {
|
|||||||
result := android.GroupFixturePreparers(
|
result := android.GroupFixturePreparers(
|
||||||
prepareForTestWithSystemserverclasspathFragment,
|
prepareForTestWithSystemserverclasspathFragment,
|
||||||
prepareForTestWithMyapex,
|
prepareForTestWithMyapex,
|
||||||
|
dexpreopt.FixtureSetApexSystemServerJars("myapex:foo"),
|
||||||
).RunTestWithBp(t, `
|
).RunTestWithBp(t, `
|
||||||
apex {
|
apex {
|
||||||
name: "myapex",
|
name: "myapex",
|
||||||
|
@@ -125,6 +125,20 @@ func FixtureSetApexBootJars(bootJars ...string) android.FixturePreparer {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FixtureSetSystemServerJars sets the SystemServerJars property.
|
||||||
|
func FixtureSetSystemServerJars(jars ...string) android.FixturePreparer {
|
||||||
|
return FixtureModifyGlobalConfig(func(dexpreoptConfig *GlobalConfig) {
|
||||||
|
dexpreoptConfig.SystemServerJars = android.CreateTestConfiguredJarList(jars)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// FixtureSetApexSystemServerJars sets the ApexSystemServerJars property in the global config.
|
||||||
|
func FixtureSetApexSystemServerJars(jars ...string) android.FixturePreparer {
|
||||||
|
return FixtureModifyGlobalConfig(func(dexpreoptConfig *GlobalConfig) {
|
||||||
|
dexpreoptConfig.ApexSystemServerJars = android.CreateTestConfiguredJarList(jars)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// FixtureSetPreoptWithUpdatableBcp sets the PreoptWithUpdatableBcp property in the global config.
|
// FixtureSetPreoptWithUpdatableBcp sets the PreoptWithUpdatableBcp property in the global config.
|
||||||
func FixtureSetPreoptWithUpdatableBcp(value bool) android.FixturePreparer {
|
func FixtureSetPreoptWithUpdatableBcp(value bool) android.FixturePreparer {
|
||||||
return FixtureModifyGlobalConfig(func(dexpreoptConfig *GlobalConfig) {
|
return FixtureModifyGlobalConfig(func(dexpreoptConfig *GlobalConfig) {
|
||||||
|
@@ -164,6 +164,7 @@ func TestBootclasspathFragment_Coverage(t *testing.T) {
|
|||||||
prepareForTestWithBootclasspathFragment,
|
prepareForTestWithBootclasspathFragment,
|
||||||
PrepareForTestWithJavaSdkLibraryFiles,
|
PrepareForTestWithJavaSdkLibraryFiles,
|
||||||
FixtureWithLastReleaseApis("mysdklibrary", "mycoveragestubs"),
|
FixtureWithLastReleaseApis("mysdklibrary", "mycoveragestubs"),
|
||||||
|
FixtureConfigureApexBootJars("someapex:mybootlib"),
|
||||||
prepareWithBp,
|
prepareWithBp,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -186,6 +187,7 @@ func TestBootclasspathFragment_StubLibs(t *testing.T) {
|
|||||||
prepareForTestWithBootclasspathFragment,
|
prepareForTestWithBootclasspathFragment,
|
||||||
PrepareForTestWithJavaSdkLibraryFiles,
|
PrepareForTestWithJavaSdkLibraryFiles,
|
||||||
FixtureWithLastReleaseApis("mysdklibrary", "myothersdklibrary", "mycoreplatform"),
|
FixtureWithLastReleaseApis("mysdklibrary", "myothersdklibrary", "mycoreplatform"),
|
||||||
|
FixtureConfigureApexBootJars("someapex:mysdklibrary"),
|
||||||
).RunTestWithBp(t, `
|
).RunTestWithBp(t, `
|
||||||
bootclasspath_fragment {
|
bootclasspath_fragment {
|
||||||
name: "myfragment",
|
name: "myfragment",
|
||||||
|
@@ -566,6 +566,7 @@ func TestSnapshotWithBootClasspathFragment_Fragments(t *testing.T) {
|
|||||||
java.PrepareForTestWithJavaDefaultModules,
|
java.PrepareForTestWithJavaDefaultModules,
|
||||||
java.PrepareForTestWithJavaSdkLibraryFiles,
|
java.PrepareForTestWithJavaSdkLibraryFiles,
|
||||||
java.FixtureWithLastReleaseApis("mysdklibrary", "myothersdklibrary"),
|
java.FixtureWithLastReleaseApis("mysdklibrary", "myothersdklibrary"),
|
||||||
|
java.FixtureConfigureApexBootJars("someapex:mysdklibrary", "myotherapex:myotherlib"),
|
||||||
prepareForSdkTestWithApex,
|
prepareForSdkTestWithApex,
|
||||||
|
|
||||||
// Some additional files needed for the myotherapex.
|
// Some additional files needed for the myotherapex.
|
||||||
|
Reference in New Issue
Block a user