Merge "Fix hiddenapi tests to work without javaMockFS()" am: 248f386558
am: 609df5c2ca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1634630 Change-Id: Ie65ddae0cde35a55da648eebd2ea76a37498963e
This commit is contained in:
@@ -56,6 +56,8 @@ func TestHiddenAPISingleton(t *testing.T) {
|
|||||||
|
|
||||||
func TestHiddenAPIIndexSingleton(t *testing.T) {
|
func TestHiddenAPIIndexSingleton(t *testing.T) {
|
||||||
result := hiddenApiFixtureFactory.Extend(
|
result := hiddenApiFixtureFactory.Extend(
|
||||||
|
PrepareForTestWithJavaSdkLibraryFiles,
|
||||||
|
FixtureWithLastReleaseApis("bar"),
|
||||||
fixtureSetBootJarsProductVariable("platform:foo", "platform:bar"),
|
fixtureSetBootJarsProductVariable("platform:foo", "platform:bar"),
|
||||||
).RunTestWithBp(t, `
|
).RunTestWithBp(t, `
|
||||||
java_library {
|
java_library {
|
||||||
@@ -209,6 +211,9 @@ func TestHiddenAPISingletonSdks(t *testing.T) {
|
|||||||
systemStub string
|
systemStub string
|
||||||
testStub string
|
testStub string
|
||||||
corePlatformStub string
|
corePlatformStub string
|
||||||
|
|
||||||
|
// Additional test preparer
|
||||||
|
preparer android.FixturePreparer
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "testBundled",
|
name: "testBundled",
|
||||||
@@ -217,6 +222,7 @@ func TestHiddenAPISingletonSdks(t *testing.T) {
|
|||||||
systemStub: "android_system_stubs_current",
|
systemStub: "android_system_stubs_current",
|
||||||
testStub: "android_test_stubs_current",
|
testStub: "android_test_stubs_current",
|
||||||
corePlatformStub: "legacy.core.platform.api.stubs",
|
corePlatformStub: "legacy.core.platform.api.stubs",
|
||||||
|
preparer: android.GroupFixturePreparers(),
|
||||||
}, {
|
}, {
|
||||||
name: "testUnbundled",
|
name: "testUnbundled",
|
||||||
unbundledBuild: true,
|
unbundledBuild: true,
|
||||||
@@ -224,11 +230,13 @@ func TestHiddenAPISingletonSdks(t *testing.T) {
|
|||||||
systemStub: "sdk_system_current_android",
|
systemStub: "sdk_system_current_android",
|
||||||
testStub: "sdk_test_current_android",
|
testStub: "sdk_test_current_android",
|
||||||
corePlatformStub: "legacy.core.platform.api.stubs",
|
corePlatformStub: "legacy.core.platform.api.stubs",
|
||||||
|
preparer: PrepareForTestWithPrebuiltsOfCurrentApi,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
t.Run(tc.name, func(t *testing.T) {
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
result := hiddenApiFixtureFactory.Extend(
|
result := hiddenApiFixtureFactory.Extend(
|
||||||
|
tc.preparer,
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||||
variables.Always_use_prebuilt_sdks = proptools.BoolPtr(tc.unbundledBuild)
|
variables.Always_use_prebuilt_sdks = proptools.BoolPtr(tc.unbundledBuild)
|
||||||
}),
|
}),
|
||||||
|
Reference in New Issue
Block a user