From 8539023170a7574df4d8b6a6688f9e95232b00f7 Mon Sep 17 00:00:00 2001 From: Sasha Smundak Date: Thu, 23 Apr 2020 09:49:59 -0700 Subject: Implement android_app_set module Bug: 152319766 Test: manual and builtin Change-Id: Id0877476f9ae23311d92c0b59a9c568140ab4119 Merged-In: Id0877476f9ae23311d92c0b59a9c568140ab4119 --- java/java_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'java/java_test.go') diff --git a/java/java_test.go b/java/java_test.go index 31b23e764..50b2f69d9 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -88,6 +88,7 @@ func testContext(config android.Config, bp string, ctx.RegisterModuleType("java_sdk_library", android.ModuleFactoryAdaptor(SdkLibraryFactory)) ctx.RegisterModuleType("override_android_app", android.ModuleFactoryAdaptor(OverrideAndroidAppModuleFactory)) ctx.RegisterModuleType("prebuilt_apis", android.ModuleFactoryAdaptor(PrebuiltApisFactory)) + ctx.RegisterModuleType("android_app_set", android.ModuleFactoryAdaptor(AndroidApkSetFactory)) ctx.PreArchMutators(android.RegisterPrebuiltsPreArchMutators) ctx.PreArchMutators(android.RegisterPrebuiltsPostDepsMutators) ctx.PreArchMutators(android.RegisterDefaultsPreArchMutators) @@ -167,6 +168,8 @@ func testContext(config android.Config, bp string, "prebuilts/sdk/tools/core-lambda-stubs.jar": nil, "prebuilts/sdk/Android.bp": []byte(`prebuilt_apis { name: "sdk", api_dirs: ["14", "28", "current"],}`), + "prebuilts/apks/app.apks": nil, + // For framework-res, which is an implicit dependency for framework "AndroidManifest.xml": nil, "build/target/product/security/testkey": nil, @@ -212,6 +215,27 @@ func run(t *testing.T, ctx *android.TestContext, config android.Config) { android.FailIfErrored(t, errs) } +func testJavaError(t *testing.T, pattern string, bp string) (*android.TestContext, android.Config) { + t.Helper() + config := testConfig(nil) + ctx := testContext(config, bp, nil) + + _, errs := ctx.ParseBlueprintsFiles("Android.bp") + if len(errs) > 0 { + android.FailIfNoMatchingErrors(t, pattern, errs) + return ctx, config + } + _, errs = ctx.PrepareBuildActions(config) + if len(errs) > 0 { + android.FailIfNoMatchingErrors(t, pattern, errs) + return ctx, config + } + + t.Fatalf("missing expected error %q (0 errors are returned)", pattern) + + return ctx, config +} + func testJava(t *testing.T, bp string) *android.TestContext { t.Helper() config := testConfig(nil) -- cgit v1.2.3-59-g8ed1b