Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c460567 authored by Colin Cross's avatar Colin Cross
Browse files

Remove extra return value from testApex

The config value returned by testApex is no longer used, remove it.

Test: go test  ./apex
Change-Id: I9327c1b139c17305454fb0a111e41456cdcaebc3
parent aa255538
Loading
Loading
Loading
Loading
+98 −98
Original line number Diff line number Diff line
@@ -66,14 +66,14 @@ func testApexError(t *testing.T, pattern, bp string, handlers ...testCustomizer)
	t.Fatalf("missing expected error %q (0 errors are returned)", pattern)
}

func testApex(t *testing.T, bp string, handlers ...testCustomizer) (*android.TestContext, android.Config) {
func testApex(t *testing.T, bp string, handlers ...testCustomizer) *android.TestContext {
	t.Helper()
	ctx, config := testApexContext(t, bp, handlers...)
	_, errs := ctx.ParseBlueprintsFiles(".")
	android.FailIfErrored(t, errs)
	_, errs = ctx.PrepareBuildActions(config)
	android.FailIfErrored(t, errs)
	return ctx, config
	return ctx
}

type testCustomizer func(fs map[string][]byte, config android.Config)
@@ -354,7 +354,7 @@ func ensureListNotEmpty(t *testing.T, result []string) {

// Minimal test
func TestBasicApex(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex_defaults {
			name: "myapex-defaults",
			manifest: ":myapex.manifest",
@@ -658,7 +658,7 @@ func TestBasicApex(t *testing.T) {
}

func TestDefaults(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex_defaults {
			name: "myapex-defaults",
			key: "myapex.key",
@@ -732,7 +732,7 @@ func TestDefaults(t *testing.T) {
}

func TestApexManifest(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -753,7 +753,7 @@ func TestApexManifest(t *testing.T) {
}

func TestBasicZipApex(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -803,7 +803,7 @@ func TestBasicZipApex(t *testing.T) {
}

func TestApexWithStubs(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -897,7 +897,7 @@ func TestApexWithStubs(t *testing.T) {

func TestApexWithStubsWithMinSdkVersion(t *testing.T) {
	t.Parallel()
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -1004,7 +1004,7 @@ func TestApex_PlatformUsesLatestStubFromApex(t *testing.T) {
	//                                  |
	//   <platform>                     |
	//      libplatform ----------------'
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -1069,7 +1069,7 @@ func TestApex_PlatformUsesLatestStubFromApex(t *testing.T) {
}

func TestApexWithExplicitStubsDependency(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex2",
			key: "myapex2.key",
@@ -1164,7 +1164,7 @@ func TestApexWithRuntimeLibsDependency(t *testing.T) {
			    |
			    `------> libbar
	*/
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -1225,7 +1225,7 @@ func TestApexWithRuntimeLibsDependency(t *testing.T) {
}

func TestRuntimeApexShouldInstallHwasanIfLibcDependsOnIt(t *testing.T) {
	ctx, _ := testApex(t, "", func(fs map[string][]byte, config android.Config) {
	ctx := testApex(t, "", func(fs map[string][]byte, config android.Config) {
		bp := `
		apex {
			name: "com.android.runtime",
@@ -1288,7 +1288,7 @@ func TestRuntimeApexShouldInstallHwasanIfLibcDependsOnIt(t *testing.T) {
}

func TestRuntimeApexShouldInstallHwasanIfHwaddressSanitized(t *testing.T) {
	ctx, _ := testApex(t, "", func(fs map[string][]byte, config android.Config) {
	ctx := testApex(t, "", func(fs map[string][]byte, config android.Config) {
		bp := `
		apex {
			name: "com.android.runtime",
@@ -1373,7 +1373,7 @@ func TestApexDependsOnLLNDKTransitively(t *testing.T) {
	}
	for _, tc := range testcases {
		t.Run(tc.name, func(t *testing.T) {
			ctx, _ := testApex(t, `
			ctx := testApex(t, `
			apex {
				name: "myapex",
				key: "myapex.key",
@@ -1439,7 +1439,7 @@ func TestApexDependsOnLLNDKTransitively(t *testing.T) {
}

func TestApexWithSystemLibsStubs(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -1534,7 +1534,7 @@ func TestApexMinSdkVersion_NativeModulesShouldBeBuiltAgainstStubs(t *testing.T)
	// 1) myapex -> libx -> liba -> libz    : this should be #29 link, but fallback to #28
	// 2) otherapex -> liby -> liba -> libz : this should be #30 link
	// 3) (platform) -> liba -> libz        : this should be non-stub link
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -1616,7 +1616,7 @@ func TestApexMinSdkVersion_NativeModulesShouldBeBuiltAgainstStubs(t *testing.T)
}

func TestApexMinSdkVersion_SupportsCodeNames(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -1665,7 +1665,7 @@ func TestApexMinSdkVersion_SupportsCodeNames(t *testing.T) {
}

func TestApexMinSdkVersion_DefaultsToLatest(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -1710,7 +1710,7 @@ func TestApexMinSdkVersion_DefaultsToLatest(t *testing.T) {
}

func TestPlatformUsesLatestStubsFromApexes(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -1757,7 +1757,7 @@ func TestPlatformUsesLatestStubsFromApexes(t *testing.T) {
}

func TestQApexesUseLatestStubsInBundledBuildsAndHWASAN(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -1796,7 +1796,7 @@ func TestQApexesUseLatestStubsInBundledBuildsAndHWASAN(t *testing.T) {
}

func TestQTargetApexUsesStaticUnwinder(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -2157,7 +2157,7 @@ func TestApexMinSdkVersion_ErrorIfDepIsNewer_Java(t *testing.T) {
}

func TestApexMinSdkVersion_OkayEvenWhenDepIsNewer_IfItSatisfiesApexMinSdkVersion(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -2244,7 +2244,7 @@ func TestApexMinSdkVersion_WorksWithActiveCodenames(t *testing.T) {
		config.TestProductVariables.Platform_sdk_codename = proptools.StringPtr("S")
		config.TestProductVariables.Platform_version_active_codenames = []string{"S", "T"}
	}
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -2278,7 +2278,7 @@ func TestApexMinSdkVersion_WorksWithActiveCodenames(t *testing.T) {
}

func TestFilesInSubDir(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -2340,7 +2340,7 @@ func TestFilesInSubDir(t *testing.T) {
}

func TestFilesInSubDirWhenNativeBridgeEnabled(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -2398,7 +2398,7 @@ func TestFilesInSubDirWhenNativeBridgeEnabled(t *testing.T) {
}

func TestUseVendor(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -2508,7 +2508,7 @@ func TestUseVendorFailsIfNotVendorAvailable(t *testing.T) {
}

func TestVendorApex(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -2553,7 +2553,7 @@ func TestVendorApex(t *testing.T) {
}

func TestVendorApex_use_vndk_as_stable(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -2616,7 +2616,7 @@ func TestApex_withPrebuiltFirmware(t *testing.T) {
	}
	for _, tc := range testCases {
		t.Run(tc.name, func(t *testing.T) {
			ctx, _ := testApex(t, `
			ctx := testApex(t, `
				apex {
					name: "myapex",
					key: "myapex.key",
@@ -2643,7 +2643,7 @@ func TestApex_withPrebuiltFirmware(t *testing.T) {
}

func TestAndroidMk_UseVendorRequired(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -2677,7 +2677,7 @@ func TestAndroidMk_UseVendorRequired(t *testing.T) {
}

func TestAndroidMk_VendorApexRequired(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -2708,7 +2708,7 @@ func TestAndroidMk_VendorApexRequired(t *testing.T) {
}

func TestAndroidMkWritesCommonProperties(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -2737,7 +2737,7 @@ func TestAndroidMkWritesCommonProperties(t *testing.T) {
}

func TestStaticLinking(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -2781,7 +2781,7 @@ func TestStaticLinking(t *testing.T) {
}

func TestKeys(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex_keytest",
			key: "myapex.key",
@@ -2838,7 +2838,7 @@ func TestKeys(t *testing.T) {

func TestCertificate(t *testing.T) {
	t.Run("if unspecified, it defaults to DefaultAppCertificate", func(t *testing.T) {
		ctx, _ := testApex(t, `
		ctx := testApex(t, `
			apex {
				name: "myapex",
				key: "myapex.key",
@@ -2855,7 +2855,7 @@ func TestCertificate(t *testing.T) {
		}
	})
	t.Run("override when unspecified", func(t *testing.T) {
		ctx, _ := testApex(t, `
		ctx := testApex(t, `
			apex {
				name: "myapex_keytest",
				key: "myapex.key",
@@ -2877,7 +2877,7 @@ func TestCertificate(t *testing.T) {
		}
	})
	t.Run("if specified as :module, it respects the prop", func(t *testing.T) {
		ctx, _ := testApex(t, `
		ctx := testApex(t, `
			apex {
				name: "myapex",
				key: "myapex.key",
@@ -2899,7 +2899,7 @@ func TestCertificate(t *testing.T) {
		}
	})
	t.Run("override when specifiec as <:module>", func(t *testing.T) {
		ctx, _ := testApex(t, `
		ctx := testApex(t, `
			apex {
				name: "myapex_keytest",
				key: "myapex.key",
@@ -2922,7 +2922,7 @@ func TestCertificate(t *testing.T) {
		}
	})
	t.Run("if specified as name, finds it from DefaultDevKeyDir", func(t *testing.T) {
		ctx, _ := testApex(t, `
		ctx := testApex(t, `
			apex {
				name: "myapex",
				key: "myapex.key",
@@ -2940,7 +2940,7 @@ func TestCertificate(t *testing.T) {
		}
	})
	t.Run("override when specified as <name>", func(t *testing.T) {
		ctx, _ := testApex(t, `
		ctx := testApex(t, `
			apex {
				name: "myapex_keytest",
				key: "myapex.key",
@@ -2965,7 +2965,7 @@ func TestCertificate(t *testing.T) {
}

func TestMacro(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -3092,7 +3092,7 @@ func TestMacro(t *testing.T) {
}

func TestHeaderLibsDependency(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -3235,7 +3235,7 @@ func ensureExactContents(t *testing.T, ctx *android.TestContext, moduleName, var
}

func TestVndkApexCurrent(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex_vndk {
			name: "myapex",
			key: "myapex.key",
@@ -3291,7 +3291,7 @@ func TestVndkApexCurrent(t *testing.T) {
}

func TestVndkApexWithPrebuilt(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex_vndk {
			name: "myapex",
			key: "myapex.key",
@@ -3375,7 +3375,7 @@ func vndkLibrariesTxtFiles(vers ...string) (result string) {
}

func TestVndkApexVersion(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex_vndk {
			name: "myapex_v27",
			key: "myapex.key",
@@ -3491,7 +3491,7 @@ func TestVndkApexErrorWithDuplicateVersion(t *testing.T) {
}

func TestVndkApexNameRule(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex_vndk {
			name: "myapex",
			key: "myapex.key",
@@ -3522,7 +3522,7 @@ func TestVndkApexNameRule(t *testing.T) {
}

func TestVndkApexSkipsNativeBridgeSupportedModules(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex_vndk {
			name: "myapex",
			key: "myapex.key",
@@ -3592,7 +3592,7 @@ func TestVndkApexDoesntSupportNativeBridgeSupported(t *testing.T) {
}

func TestVndkApexWithBinder32(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex_vndk {
			name: "myapex_v27",
			key: "myapex.key",
@@ -3660,7 +3660,7 @@ func TestVndkApexWithBinder32(t *testing.T) {
}

func TestVndkApexShouldNotProvideNativeLibs(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex_vndk {
			name: "myapex",
			key: "myapex.key",
@@ -3695,7 +3695,7 @@ func TestVndkApexShouldNotProvideNativeLibs(t *testing.T) {
}

func TestDependenciesInApexManifest(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex_nodep",
			key: "myapex.key",
@@ -3799,7 +3799,7 @@ func TestDependenciesInApexManifest(t *testing.T) {
}

func TestApexName(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -3843,7 +3843,7 @@ func TestApexName(t *testing.T) {
}

func TestNonTestApex(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -3895,7 +3895,7 @@ func TestNonTestApex(t *testing.T) {
}

func TestTestApex(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex_test {
			name: "myapex",
			key: "myapex.key",
@@ -3943,7 +3943,7 @@ func TestTestApex(t *testing.T) {
}

func TestApexWithTarget(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -4033,7 +4033,7 @@ func TestApexWithTarget(t *testing.T) {
}

func TestApexWithArch(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -4091,7 +4091,7 @@ func TestApexWithArch(t *testing.T) {
}

func TestApexWithShBinary(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -4131,7 +4131,7 @@ func TestApexInVariousPartition(t *testing.T) {
	}
	for _, tc := range testcases {
		t.Run(tc.propName+":"+tc.parition, func(t *testing.T) {
			ctx, _ := testApex(t, `
			ctx := testApex(t, `
				apex {
					name: "myapex",
					key: "myapex.key",
@@ -4163,7 +4163,7 @@ func TestApexInVariousPartition(t *testing.T) {
}

func TestFileContexts_FindInDefaultLocationIfNotSet(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -4214,7 +4214,7 @@ func TestFileContexts_ProductSpecificApexes(t *testing.T) {
		}
	`)

	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -4236,7 +4236,7 @@ func TestFileContexts_ProductSpecificApexes(t *testing.T) {
}

func TestFileContexts_SetViaFileGroup(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -4263,7 +4263,7 @@ func TestFileContexts_SetViaFileGroup(t *testing.T) {
}

func TestApexKeyFromOtherModule(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex_key {
			name: "myapex.key",
			public_key: ":my.avbpubkey",
@@ -4296,7 +4296,7 @@ func TestApexKeyFromOtherModule(t *testing.T) {
}

func TestPrebuilt(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		prebuilt_apex {
			name: "myapex",
			arch: {
@@ -4319,7 +4319,7 @@ func TestPrebuilt(t *testing.T) {
}

func TestPrebuiltFilenameOverride(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		prebuilt_apex {
			name: "myapex",
			src: "myapex-arm.apex",
@@ -4336,7 +4336,7 @@ func TestPrebuiltFilenameOverride(t *testing.T) {
}

func TestPrebuiltOverrides(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		prebuilt_apex {
			name: "myapex.prebuilt",
			src: "myapex-arm.apex",
@@ -4708,7 +4708,7 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
}

func TestApexWithTests(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex_test {
			name: "myapex",
			key: "myapex.key",
@@ -4819,7 +4819,7 @@ func TestApexWithTests(t *testing.T) {
}

func TestInstallExtraFlattenedApexes(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -4888,7 +4888,7 @@ func TestErrorsIfDepsAreNotEnabled(t *testing.T) {
}

func TestApexWithJavaImport(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -4916,7 +4916,7 @@ func TestApexWithJavaImport(t *testing.T) {
}

func TestApexWithApps(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -4994,7 +4994,7 @@ func TestApexWithApps(t *testing.T) {
}

func TestApexWithAppImports(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -5042,7 +5042,7 @@ func TestApexWithAppImports(t *testing.T) {
}

func TestApexWithAppImportsPrefer(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -5083,7 +5083,7 @@ func TestApexWithAppImportsPrefer(t *testing.T) {
}

func TestApexWithTestHelperApp(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -5286,7 +5286,7 @@ func TestApexAvailable_InvalidApexName(t *testing.T) {
}

func TestApexAvailable_CheckForPlatform(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
	apex {
		name: "myapex",
		key: "myapex.key",
@@ -5348,7 +5348,7 @@ func TestApexAvailable_CheckForPlatform(t *testing.T) {
}

func TestApexAvailable_CreatedForApex(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
	apex {
		name: "myapex",
		key: "myapex.key",
@@ -5382,7 +5382,7 @@ func TestApexAvailable_CreatedForApex(t *testing.T) {
}

func TestOverrideApex(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -5465,7 +5465,7 @@ func TestOverrideApex(t *testing.T) {
}

func TestLegacyAndroid10Support(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -5525,7 +5525,7 @@ var filesForSdkLibrary = map[string][]byte{
}

func TestJavaSDKLibrary(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -5562,7 +5562,7 @@ func TestJavaSDKLibrary(t *testing.T) {
}

func TestJavaSDKLibrary_WithinApex(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -5614,7 +5614,7 @@ func TestJavaSDKLibrary_WithinApex(t *testing.T) {
}

func TestJavaSDKLibrary_CrossBoundary(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -5664,7 +5664,7 @@ func TestJavaSDKLibrary_CrossBoundary(t *testing.T) {
}

func TestJavaSDKLibrary_ImportPreferred(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		prebuilt_apis {
			name: "sdk",
			api_dirs: ["100"],
@@ -5779,7 +5779,7 @@ func TestJavaSDKLibrary_ImportOnly(t *testing.T) {
}

func TestCompatConfig(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -5838,7 +5838,7 @@ func TestRejectNonInstallableJavaLibrary(t *testing.T) {
}

func TestCarryRequiredModuleNames(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -5980,7 +5980,7 @@ func TestSymlinksFromApexToSystem(t *testing.T) {

	// For unbundled build, symlink shouldn't exist regardless of whether an APEX
	// is updatable or not
	ctx, _ := testApex(t, bp, withUnbundledBuild)
	ctx := testApex(t, bp, withUnbundledBuild)
	files := getFiles(t, ctx, "myapex", "android_common_myapex_image")
	ensureRealfileExists(t, files, "javalib/myjar.jar")
	ensureRealfileExists(t, files, "lib64/mylib.so")
@@ -5992,7 +5992,7 @@ func TestSymlinksFromApexToSystem(t *testing.T) {
	ensureRealfileExists(t, files, "lib64/myotherlib.so")

	// For bundled build, symlink to the system for the non-updatable APEXes only
	ctx, _ = testApex(t, bp)
	ctx = testApex(t, bp)
	files = getFiles(t, ctx, "myapex", "android_common_myapex_image")
	ensureRealfileExists(t, files, "javalib/myjar.jar")
	ensureRealfileExists(t, files, "lib64/mylib.so")
@@ -6005,7 +6005,7 @@ func TestSymlinksFromApexToSystem(t *testing.T) {
}

func TestSymlinksFromApexToSystemRequiredModuleNames(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -6056,7 +6056,7 @@ func TestSymlinksFromApexToSystemRequiredModuleNames(t *testing.T) {
}

func TestApexWithJniLibs(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -6097,7 +6097,7 @@ func TestApexWithJniLibs(t *testing.T) {
}

func TestApexMutatorsDontRunIfDisabled(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -6118,7 +6118,7 @@ func TestApexMutatorsDontRunIfDisabled(t *testing.T) {
}

func TestAppBundle(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -6148,7 +6148,7 @@ func TestAppBundle(t *testing.T) {
}

func TestAppSetBundle(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -6180,7 +6180,7 @@ func TestAppSetBundle(t *testing.T) {
}

func TestAppSetBundlePrebuilt(t *testing.T) {
	ctx, _ := testApex(t, "", func(fs map[string][]byte, config android.Config) {
	ctx := testApex(t, "", func(fs map[string][]byte, config android.Config) {
		bp := `
		apex_set {
			name: "myapex",
@@ -6643,7 +6643,7 @@ func TestApexPermittedPackagesRules(t *testing.T) {
}

func TestTestFor(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -6728,7 +6728,7 @@ func intPtr(i int) *int {
}

func TestApexSet(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex_set {
			name: "myapex",
			set: "myapex.apks",
@@ -6803,7 +6803,7 @@ func TestNoStaticLinkingToStubsLib(t *testing.T) {
}

func TestApexKeysTxt(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -6843,7 +6843,7 @@ func TestApexKeysTxt(t *testing.T) {
}

func TestAllowedFiles(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -6898,7 +6898,7 @@ func TestAllowedFiles(t *testing.T) {
}

func TestNonPreferredPrebuiltDependency(t *testing.T) {
	_, _ = testApex(t, `
	testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -6933,7 +6933,7 @@ func TestNonPreferredPrebuiltDependency(t *testing.T) {
}

func TestCompressedApex(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -6967,7 +6967,7 @@ func TestCompressedApex(t *testing.T) {
}

func TestPreferredPrebuiltSharedLibDep(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -7018,7 +7018,7 @@ func TestPreferredPrebuiltSharedLibDep(t *testing.T) {
}

func TestExcludeDependency(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
@@ -7159,7 +7159,7 @@ func TestPrebuiltStubLibDep(t *testing.T) {
		t.Run(test.name, func(t *testing.T) {
			for _, otherApexEnabled := range test.otherApexEnabled {
				t.Run("otherapex_enabled_"+otherApexEnabled, func(t *testing.T) {
					ctx, _ := testApex(t, fmt.Sprintf(bpBase, otherApexEnabled)+test.stublibBp)
					ctx := testApex(t, fmt.Sprintf(bpBase, otherApexEnabled)+test.stublibBp)

					type modAndMkEntries struct {
						mod       *cc.Module
+2 −2
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ import (
// modules from the ART apex.

func TestBootImages(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		java_sdk_library {
			name: "foo",
			srcs: ["b.java"],
@@ -180,7 +180,7 @@ func withFrameworkBootImageJars(bootJars ...string) func(fs map[string][]byte, c
}

func TestBootImageInApex(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
+4 −4
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ import (
)

func TestVndkApexForVndkLite(t *testing.T) {
	ctx, _ := testApex(t, `
	ctx := testApex(t, `
		apex_vndk {
			name: "myapex",
			key: "myapex.key",
@@ -98,7 +98,7 @@ func TestVndkApexUsesVendorVariant(t *testing.T) {
	}

	t.Run("VNDK lib doesn't have an apex variant", func(t *testing.T) {
		ctx, _ := testApex(t, bp)
		ctx := testApex(t, bp)

		// libfoo doesn't have apex variants
		for _, variant := range ctx.ModuleVariantsForTests("libfoo") {
@@ -111,7 +111,7 @@ func TestVndkApexUsesVendorVariant(t *testing.T) {
	})

	t.Run("VNDK APEX gathers only vendor variants even if product variants are available", func(t *testing.T) {
		ctx, _ := testApex(t, bp, func(fs map[string][]byte, config android.Config) {
		ctx := testApex(t, bp, func(fs map[string][]byte, config android.Config) {
			// Now product variant is available
			config.TestProductVariables.ProductVndkVersion = proptools.StringPtr("current")
		})
@@ -121,7 +121,7 @@ func TestVndkApexUsesVendorVariant(t *testing.T) {
	})

	t.Run("VNDK APEX supports coverage variants", func(t *testing.T) {
		ctx, _ := testApex(t, bp, func(fs map[string][]byte, config android.Config) {
		ctx := testApex(t, bp, func(fs map[string][]byte, config android.Config) {
			config.TestProductVariables.GcovCoverage = proptools.BoolPtr(true)
			config.TestProductVariables.Native_coverage = proptools.BoolPtr(true)
		})