Merge "Fix app tests to work without javaMockFS()" am: e26e597fc8

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1634633

Change-Id: I045684237af489507cc6436b760c41e94dac8bce
This commit is contained in:
Paul Duffin
2021-03-18 08:17:36 +00:00
committed by Automerger Merge Worker

View File

@@ -375,6 +375,9 @@ func TestUpdatableApps(t *testing.T) {
errorHandler = android.FixtureExpectsAtLeastOneErrorMatchingPattern(test.expectedError) errorHandler = android.FixtureExpectsAtLeastOneErrorMatchingPattern(test.expectedError)
} }
javaFixtureFactory. javaFixtureFactory.
Extend(FixtureWithPrebuiltApis(map[string][]string{
"29": {"foo"},
})).
ExtendWithErrorHandler(errorHandler).RunTestWithBp(t, test.bp) ExtendWithErrorHandler(errorHandler).RunTestWithBp(t, test.bp)
}) })
} }
@@ -1081,6 +1084,9 @@ func TestAppSdkVersion(t *testing.T) {
variables.Platform_version_active_codenames = test.activeCodenames variables.Platform_version_active_codenames = test.activeCodenames
variables.Platform_sdk_final = &test.platformSdkFinal variables.Platform_sdk_final = &test.platformSdkFinal
}), }),
FixtureWithPrebuiltApis(map[string][]string{
"14": {"foo"},
}),
).RunTestWithBp(t, bp) ).RunTestWithBp(t, bp)
checkSdkVersion(t, result, test.expectedMinSdkVersion) checkSdkVersion(t, result, test.expectedMinSdkVersion)
@@ -1147,6 +1153,11 @@ func TestVendorAppSdkVersion(t *testing.T) {
variables.DeviceCurrentApiLevelForVendorModules = &test.deviceCurrentApiLevelForVendorModules variables.DeviceCurrentApiLevelForVendorModules = &test.deviceCurrentApiLevelForVendorModules
variables.DeviceSystemSdkVersions = []string{"28", "29"} variables.DeviceSystemSdkVersions = []string{"28", "29"}
}), }),
FixtureWithPrebuiltApis(map[string][]string{
"28": {"foo"},
"29": {"foo"},
"current": {"foo"},
}),
).RunTestWithBp(t, bp) ).RunTestWithBp(t, bp)
checkSdkVersion(t, result, test.expectedMinSdkVersion) checkSdkVersion(t, result, test.expectedMinSdkVersion)
@@ -2359,6 +2370,8 @@ func TestUsesLibraries(t *testing.T) {
` `
result := javaFixtureFactory.Extend( result := javaFixtureFactory.Extend(
PrepareForTestWithJavaSdkLibraryFiles,
FixtureWithLastReleaseApis("runtime-library", "foo", "quuz", "qux", "bar", "fred"),
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) { android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
variables.MissingUsesLibraries = []string{"baz"} variables.MissingUsesLibraries = []string{"baz"}
}), }),
@@ -2706,6 +2719,7 @@ func TestUncompressDex(t *testing.T) {
t.Helper() t.Helper()
result := javaFixtureFactory.Extend( result := javaFixtureFactory.Extend(
PrepareForTestWithPrebuiltsOfCurrentApi,
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) { android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
if unbundled { if unbundled {
variables.Unbundled_build = proptools.BoolPtr(true) variables.Unbundled_build = proptools.BoolPtr(true)