diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/androidmk_test.go | 9 | ||||
-rw-r--r-- | java/app_test.go | 48 | ||||
-rw-r--r-- | java/device_host_converter_test.go | 2 | ||||
-rw-r--r-- | java/dexpreopt_bootjars_test.go | 2 | ||||
-rw-r--r-- | java/dexpreopt_test.go | 1 | ||||
-rw-r--r-- | java/hiddenapi_singleton_test.go | 5 | ||||
-rw-r--r-- | java/jacoco_test.go | 2 | ||||
-rw-r--r-- | java/java_test.go | 45 | ||||
-rw-r--r-- | java/jdeps_test.go | 5 | ||||
-rw-r--r-- | java/kotlin_test.go | 3 | ||||
-rw-r--r-- | java/plugin_test.go | 3 | ||||
-rw-r--r-- | java/sdk_test.go | 1 |
12 files changed, 126 insertions, 0 deletions
diff --git a/java/androidmk_test.go b/java/androidmk_test.go index 075b7aa6f..359d8d7c4 100644 --- a/java/androidmk_test.go +++ b/java/androidmk_test.go @@ -23,6 +23,7 @@ import ( ) func TestRequired(t *testing.T) { + t.Parallel() ctx, config := testJava(t, ` java_library { name: "foo", @@ -42,6 +43,7 @@ func TestRequired(t *testing.T) { } func TestHostdex(t *testing.T) { + t.Parallel() ctx, config := testJava(t, ` java_library { name: "foo", @@ -72,6 +74,7 @@ func TestHostdex(t *testing.T) { } func TestHostdexRequired(t *testing.T) { + t.Parallel() ctx, config := testJava(t, ` java_library { name: "foo", @@ -103,6 +106,7 @@ func TestHostdexRequired(t *testing.T) { } func TestHostdexSpecificRequired(t *testing.T) { + t.Parallel() ctx, config := testJava(t, ` java_library { name: "foo", @@ -136,6 +140,7 @@ func TestHostdexSpecificRequired(t *testing.T) { } func TestDistWithTag(t *testing.T) { + t.Parallel() ctx, config := testJava(t, ` java_library { name: "foo_without_tag", @@ -172,6 +177,7 @@ func TestDistWithTag(t *testing.T) { } func TestDistWithDest(t *testing.T) { + t.Parallel() ctx, config := testJava(t, ` java_library { name: "foo", @@ -208,6 +214,7 @@ func TestDistWithDest(t *testing.T) { } func TestDistsWithAllProperties(t *testing.T) { + t.Parallel() ctx, config := testJava(t, ` java_library { name: "foo", @@ -265,6 +272,7 @@ func TestDistsWithAllProperties(t *testing.T) { } func TestDistsWithTag(t *testing.T) { + t.Parallel() ctx, config := testJava(t, ` java_library { name: "foo_without_tag", @@ -312,6 +320,7 @@ func TestDistsWithTag(t *testing.T) { } func TestJavaSdkLibrary_RequireXmlPermissionFile(t *testing.T) { + t.Parallel() ctx, config := testJava(t, ` java_sdk_library { name: "foo-shared_library", diff --git a/java/app_test.go b/java/app_test.go index 31b422c64..f8943798b 100644 --- a/java/app_test.go +++ b/java/app_test.go @@ -67,6 +67,7 @@ func testApp(t *testing.T, bp string) *android.TestContext { } func TestApp(t *testing.T) { + t.Parallel() for _, moduleType := range []string{"android_app", "android_library"} { t.Run(moduleType, func(t *testing.T) { ctx := testApp(t, moduleType+` { @@ -113,6 +114,7 @@ func TestApp(t *testing.T) { } func TestAppSplits(t *testing.T) { + t.Parallel() ctx := testApp(t, ` android_app { name: "foo", @@ -142,6 +144,7 @@ func TestAppSplits(t *testing.T) { } func TestAndroidAppSet(t *testing.T) { + t.Parallel() ctx, config := testJava(t, ` android_app_set { name: "foo", @@ -170,6 +173,7 @@ func TestAndroidAppSet(t *testing.T) { } func TestAndroidAppSet_Variants(t *testing.T) { + t.Parallel() bp := ` android_app_set { name: "foo", @@ -235,6 +239,7 @@ func TestAndroidAppSet_Variants(t *testing.T) { } func TestPlatformAPIs(t *testing.T) { + t.Parallel() testJava(t, ` android_app { name: "foo", @@ -269,6 +274,7 @@ func TestPlatformAPIs(t *testing.T) { } func TestAndroidAppLinkType(t *testing.T) { + t.Parallel() testJava(t, ` android_app { name: "foo", @@ -358,6 +364,7 @@ func TestAndroidAppLinkType(t *testing.T) { } func TestUpdatableApps(t *testing.T) { + t.Parallel() testCases := []struct { name string bp string @@ -479,6 +486,7 @@ func TestUpdatableApps(t *testing.T) { } func TestUpdatableApps_TransitiveDepsShouldSetMinSdkVersion(t *testing.T) { + t.Parallel() testJavaError(t, `module "bar".*: should support min_sdk_version\(29\)`, cc.GatherRequiredDepsForTest(android.Android)+` android_app { name: "foo", @@ -497,6 +505,7 @@ func TestUpdatableApps_TransitiveDepsShouldSetMinSdkVersion(t *testing.T) { } func TestUpdatableApps_JniLibsShouldShouldSupportMinSdkVersion(t *testing.T) { + t.Parallel() testJava(t, cc.GatherRequiredDepsForTest(android.Android)+` android_app { name: "foo", @@ -517,6 +526,7 @@ func TestUpdatableApps_JniLibsShouldShouldSupportMinSdkVersion(t *testing.T) { } func TestUpdatableApps_JniLibShouldBeBuiltAgainstMinSdkVersion(t *testing.T) { + t.Parallel() bp := cc.GatherRequiredDepsForTest(android.Android) + ` android_app { name: "foo", @@ -571,6 +581,7 @@ func TestUpdatableApps_JniLibShouldBeBuiltAgainstMinSdkVersion(t *testing.T) { } func TestUpdatableApps_ErrorIfJniLibDoesntSupportMinSdkVersion(t *testing.T) { + t.Parallel() bp := cc.GatherRequiredDepsForTest(android.Android) + ` android_app { name: "foo", @@ -591,6 +602,7 @@ func TestUpdatableApps_ErrorIfJniLibDoesntSupportMinSdkVersion(t *testing.T) { } func TestUpdatableApps_ErrorIfDepSdkVersionIsHigher(t *testing.T) { + t.Parallel() bp := cc.GatherRequiredDepsForTest(android.Android) + ` android_app { name: "foo", @@ -620,6 +632,7 @@ func TestUpdatableApps_ErrorIfDepSdkVersionIsHigher(t *testing.T) { } func TestResourceDirs(t *testing.T) { + t.Parallel() testCases := []struct { name string prop string @@ -679,6 +692,7 @@ func TestResourceDirs(t *testing.T) { } func TestLibraryAssets(t *testing.T) { + t.Parallel() bp := ` android_app { name: "foo", @@ -780,6 +794,7 @@ func TestLibraryAssets(t *testing.T) { } func TestAndroidResources(t *testing.T) { + t.Parallel() testCases := []struct { name string enforceRROTargets []string @@ -1070,6 +1085,7 @@ func checkSdkVersion(t *testing.T, config android.Config, expectedSdkVersion str } func TestAppSdkVersion(t *testing.T) { + t.Parallel() testCases := []struct { name string sdkVersion string @@ -1152,6 +1168,7 @@ func TestAppSdkVersion(t *testing.T) { } func TestVendorAppSdkVersion(t *testing.T) { + t.Parallel() testCases := []struct { name string sdkVersion string @@ -1215,6 +1232,7 @@ func TestVendorAppSdkVersion(t *testing.T) { } func TestJNIABI(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, cc.GatherRequiredDepsForTest(android.Android)+` cc_library { name: "libjni", @@ -1289,6 +1307,7 @@ func TestJNIABI(t *testing.T) { } func TestAppSdkVersionByPartition(t *testing.T) { + t.Parallel() testJavaError(t, "sdk_version must have a value when the module is located at vendor or product", ` android_app { name: "foo", @@ -1327,6 +1346,7 @@ func TestAppSdkVersionByPartition(t *testing.T) { } func TestJNIPackaging(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, cc.GatherRequiredDepsForTest(android.Android)+` cc_library { name: "libjni", @@ -1418,6 +1438,7 @@ func TestJNIPackaging(t *testing.T) { } func TestJNISDK(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, cc.GatherRequiredDepsForTest(android.Android)+` cc_library { name: "libjni", @@ -1535,6 +1556,7 @@ func TestJNISDK(t *testing.T) { } func TestCertificates(t *testing.T) { + t.Parallel() testCases := []struct { name string bp string @@ -1655,6 +1677,7 @@ func TestCertificates(t *testing.T) { } func TestRequestV4SigningFlag(t *testing.T) { + t.Parallel() testCases := []struct { name string bp string @@ -1715,6 +1738,7 @@ func TestRequestV4SigningFlag(t *testing.T) { } func TestPackageNameOverride(t *testing.T) { + t.Parallel() testCases := []struct { name string bp string @@ -1780,6 +1804,7 @@ func TestPackageNameOverride(t *testing.T) { } func TestInstrumentationTargetOverridden(t *testing.T) { + t.Parallel() bp := ` android_app { name: "foo", @@ -1809,6 +1834,7 @@ func TestInstrumentationTargetOverridden(t *testing.T) { } func TestOverrideAndroidApp(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` android_app { name: "foo", @@ -2010,6 +2036,7 @@ func TestOverrideAndroidApp(t *testing.T) { } func TestOverrideAndroidAppDependency(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` android_app { name: "foo", @@ -2052,6 +2079,7 @@ func TestOverrideAndroidAppDependency(t *testing.T) { } func TestOverrideAndroidTest(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` android_app { name: "foo", @@ -2148,6 +2176,7 @@ func TestOverrideAndroidTest(t *testing.T) { } func TestAndroidTest_FixTestConfig(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` android_app { name: "foo", @@ -2229,6 +2258,7 @@ func TestAndroidTest_FixTestConfig(t *testing.T) { } func TestAndroidAppImport(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` android_app_import { name: "foo", @@ -2258,6 +2288,7 @@ func TestAndroidAppImport(t *testing.T) { } func TestAndroidAppImport_NoDexPreopt(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` android_app_import { name: "foo", @@ -2279,6 +2310,7 @@ func TestAndroidAppImport_NoDexPreopt(t *testing.T) { } func TestAndroidAppImport_Presigned(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` android_app_import { name: "foo", @@ -2307,6 +2339,7 @@ func TestAndroidAppImport_Presigned(t *testing.T) { } func TestAndroidAppImport_SigningLineage(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` android_app_import { name: "foo", @@ -2328,6 +2361,7 @@ func TestAndroidAppImport_SigningLineage(t *testing.T) { } func TestAndroidAppImport_DefaultDevCert(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` android_app_import { name: "foo", @@ -2357,6 +2391,7 @@ func TestAndroidAppImport_DefaultDevCert(t *testing.T) { } func TestAndroidAppImport_DpiVariants(t *testing.T) { + t.Parallel() bp := ` android_app_import { name: "foo", @@ -2435,6 +2470,7 @@ func TestAndroidAppImport_DpiVariants(t *testing.T) { } func TestAndroidAppImport_Filename(t *testing.T) { + t.Parallel() ctx, config := testJava(t, ` android_app_import { name: "foo", @@ -2482,6 +2518,7 @@ func TestAndroidAppImport_Filename(t *testing.T) { } func TestAndroidAppImport_ArchVariants(t *testing.T) { + t.Parallel() // The test config's target arch is ARM64. testCases := []struct { name string @@ -2545,6 +2582,7 @@ func TestAndroidAppImport_ArchVariants(t *testing.T) { } func TestAndroidTestImport(t *testing.T) { + t.Parallel() ctx, config := testJava(t, ` android_test_import { name: "foo", @@ -2573,6 +2611,7 @@ func TestAndroidTestImport(t *testing.T) { } func TestAndroidTestImport_NoJinUncompressForPresigned(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` android_test_import { name: "foo", @@ -2610,6 +2649,7 @@ func TestAndroidTestImport_NoJinUncompressForPresigned(t *testing.T) { } func TestAndroidTestImport_Preprocessed(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` android_test_import { name: "foo", @@ -2646,6 +2686,7 @@ func TestAndroidTestImport_Preprocessed(t *testing.T) { } func TestStl(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, cc.GatherRequiredDepsForTest(android.Android)+` cc_library { name: "libjni", @@ -2709,6 +2750,7 @@ func TestStl(t *testing.T) { } func TestUsesLibraries(t *testing.T) { + t.Parallel() bp := ` java_sdk_library { name: "foo", @@ -2833,6 +2875,7 @@ func TestUsesLibraries(t *testing.T) { } func TestCodelessApp(t *testing.T) { + t.Parallel() testCases := []struct { name string bp string @@ -2909,6 +2952,7 @@ func TestCodelessApp(t *testing.T) { } func TestEmbedNotice(t *testing.T) { + t.Parallel() ctx, _ := testJavaWithFS(t, cc.GatherRequiredDepsForTest(android.Android)+` android_app { name: "foo", @@ -3018,6 +3062,7 @@ func TestEmbedNotice(t *testing.T) { } func TestUncompressDex(t *testing.T) { + t.Parallel() testCases := []struct { name string bp string @@ -3145,6 +3190,7 @@ func checkAapt2LinkFlag(t *testing.T, aapt2Flags, flagName, expectedValue string } func TestRuntimeResourceOverlay(t *testing.T) { + t.Parallel() fs := map[string][]byte{ "baz/res/res/values/strings.xml": nil, "bar/res/res/values/strings.xml": nil, @@ -3249,6 +3295,7 @@ func TestRuntimeResourceOverlay(t *testing.T) { } func TestRuntimeResourceOverlay_JavaDefaults(t *testing.T) { + t.Parallel() ctx, config := testJava(t, ` java_defaults { name: "rro_defaults", @@ -3308,6 +3355,7 @@ func TestRuntimeResourceOverlay_JavaDefaults(t *testing.T) { } func TestOverrideRuntimeResourceOverlay(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` runtime_resource_overlay { name: "foo_overlay", diff --git a/java/device_host_converter_test.go b/java/device_host_converter_test.go index 3c9a0f3f1..208ea57f6 100644 --- a/java/device_host_converter_test.go +++ b/java/device_host_converter_test.go @@ -22,6 +22,7 @@ import ( ) func TestDeviceForHost(t *testing.T) { + t.Parallel() bp := ` java_library { name: "device_module", @@ -102,6 +103,7 @@ func TestDeviceForHost(t *testing.T) { } func TestHostForDevice(t *testing.T) { + t.Parallel() bp := ` java_library_host { name: "host_module", diff --git a/java/dexpreopt_bootjars_test.go b/java/dexpreopt_bootjars_test.go index 4a8d3cd50..00bd80cb3 100644 --- a/java/dexpreopt_bootjars_test.go +++ b/java/dexpreopt_bootjars_test.go @@ -84,6 +84,7 @@ func testDexpreoptBoot(t *testing.T, ruleFile string, expectedInputs, expectedOu } func TestDexpreoptBootJars(t *testing.T) { + t.Parallel() ruleFile := "boot-foo.art" expectedInputs := []string{ @@ -114,6 +115,7 @@ func TestDexpreoptBootJars(t *testing.T) { // Changes to the boot.zip structure may break the ART APK scanner. func TestDexpreoptBootZip(t *testing.T) { + t.Parallel() ruleFile := "boot.zip" ctx := android.PathContextForTesting(testConfig(nil, "", nil)) diff --git a/java/dexpreopt_test.go b/java/dexpreopt_test.go index 5550a4c17..0bb3ac958 100644 --- a/java/dexpreopt_test.go +++ b/java/dexpreopt_test.go @@ -19,6 +19,7 @@ import ( ) func TestDexpreoptEnabled(t *testing.T) { + t.Parallel() tests := []struct { name string bp string diff --git a/java/hiddenapi_singleton_test.go b/java/hiddenapi_singleton_test.go index dbdab7ade..97dd125fb 100644 --- a/java/hiddenapi_singleton_test.go +++ b/java/hiddenapi_singleton_test.go @@ -58,6 +58,7 @@ func testHiddenAPIUnbundled(t *testing.T, unbundled bool) (*android.TestContext, } func TestHiddenAPISingleton(t *testing.T) { + t.Parallel() ctx, _ := testHiddenAPIBootJars(t, ` java_library { name: "foo", @@ -75,6 +76,7 @@ func TestHiddenAPISingleton(t *testing.T) { } func TestHiddenAPISingletonWithPrebuilt(t *testing.T) { + t.Parallel() ctx, _ := testHiddenAPIBootJars(t, ` java_import { name: "foo", @@ -92,6 +94,7 @@ func TestHiddenAPISingletonWithPrebuilt(t *testing.T) { } func TestHiddenAPISingletonWithPrebuiltUseSource(t *testing.T) { + t.Parallel() ctx, _ := testHiddenAPIBootJars(t, ` java_library { name: "foo", @@ -121,6 +124,7 @@ func TestHiddenAPISingletonWithPrebuiltUseSource(t *testing.T) { } func TestHiddenAPISingletonWithPrebuiltOverrideSource(t *testing.T) { + t.Parallel() ctx, _ := testHiddenAPIBootJars(t, ` java_library { name: "foo", @@ -150,6 +154,7 @@ func TestHiddenAPISingletonWithPrebuiltOverrideSource(t *testing.T) { } func TestHiddenAPISingletonSdks(t *testing.T) { + t.Parallel() testCases := []struct { name string unbundledBuild bool diff --git a/java/jacoco_test.go b/java/jacoco_test.go index 91f05535a..d77c916cd 100644 --- a/java/jacoco_test.go +++ b/java/jacoco_test.go @@ -17,6 +17,7 @@ package java import "testing" func TestJacocoFilterToSpecs(t *testing.T) { + t.Parallel() testCases := []struct { name, in, out string }{ @@ -66,6 +67,7 @@ func TestJacocoFilterToSpecs(t *testing.T) { } func TestJacocoFiltersToZipCommand(t *testing.T) { + t.Parallel() testCases := []struct { name string includes, excludes []string diff --git a/java/java_test.go b/java/java_test.go index a43e2a8c9..245654d1e 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -177,6 +177,7 @@ func moduleToPath(name string) string { } func TestJavaLinkType(t *testing.T) { + t.Parallel() testJava(t, ` java_library { name: "foo", @@ -265,6 +266,7 @@ func TestJavaLinkType(t *testing.T) { } func TestSimple(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_library { name: "foo", @@ -309,6 +311,7 @@ func TestSimple(t *testing.T) { } func TestExportedPlugins(t *testing.T) { + t.Parallel() type Result struct { library string processors string @@ -392,6 +395,7 @@ func TestExportedPlugins(t *testing.T) { } func TestSdkVersionByPartition(t *testing.T) { + t.Parallel() testJavaError(t, "sdk_version must have a value when the module is located at vendor or product", ` java_library { name: "foo", @@ -427,6 +431,7 @@ func TestSdkVersionByPartition(t *testing.T) { } func TestArchSpecific(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_library { name: "foo", @@ -446,6 +451,7 @@ func TestArchSpecific(t *testing.T) { } func TestBinary(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_library_host { name: "foo", @@ -474,6 +480,7 @@ func TestBinary(t *testing.T) { } func TestHostBinaryNoJavaDebugInfoOverride(t *testing.T) { + t.Parallel() bp := ` java_library { name: "target_library", @@ -509,6 +516,7 @@ func TestHostBinaryNoJavaDebugInfoOverride(t *testing.T) { } func TestPrebuilts(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_library { name: "foo", @@ -604,6 +612,7 @@ func assertDeepEquals(t *testing.T, message string, expected interface{}, actual } func TestJavaSdkLibraryImport(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_library { name: "foo", @@ -660,6 +669,7 @@ func TestJavaSdkLibraryImport(t *testing.T) { } func TestJavaSdkLibraryImport_WithSource(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_sdk_library { name: "sdklib", @@ -699,6 +709,7 @@ func TestJavaSdkLibraryImport_WithSource(t *testing.T) { } func TestJavaSdkLibraryImport_Preferred(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_sdk_library { name: "sdklib", @@ -736,6 +747,7 @@ func TestJavaSdkLibraryImport_Preferred(t *testing.T) { } func TestDefaults(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_defaults { name: "defaults", @@ -811,6 +823,7 @@ func TestDefaults(t *testing.T) { } func TestResources(t *testing.T) { + t.Parallel() var table = []struct { name string prop string @@ -917,6 +930,7 @@ func TestResources(t *testing.T) { } func TestIncludeSrcs(t *testing.T) { + t.Parallel() ctx, _ := testJavaWithFS(t, ` java_library { name: "foo", @@ -984,6 +998,7 @@ func TestIncludeSrcs(t *testing.T) { } func TestGeneratedSources(t *testing.T) { + t.Parallel() ctx, _ := testJavaWithFS(t, ` java_library { name: "foo", @@ -1020,6 +1035,7 @@ func TestGeneratedSources(t *testing.T) { } func TestTurbine(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_library { name: "foo", @@ -1069,6 +1085,7 @@ func TestTurbine(t *testing.T) { } func TestSharding(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_library { name: "bar", @@ -1087,6 +1104,7 @@ func TestSharding(t *testing.T) { } func TestDroiddoc(t *testing.T) { + t.Parallel() ctx, _ := testJavaWithFS(t, ` droiddoc_exported_dir { name: "droiddoc-templates-sdk", @@ -1165,6 +1183,7 @@ func TestDroiddoc(t *testing.T) { } func TestDroiddocArgsAndFlagsCausesError(t *testing.T) { + t.Parallel() testJavaError(t, "flags is set. Cannot set args", ` droiddoc_exported_dir { name: "droiddoc-templates-sdk", @@ -1211,6 +1230,7 @@ func TestDroiddocArgsAndFlagsCausesError(t *testing.T) { } func TestDroidstubs(t *testing.T) { + t.Parallel() ctx, _ := testJavaWithFS(t, ` droiddoc_exported_dir { name: "droiddoc-templates-sdk", @@ -1267,6 +1287,7 @@ func TestDroidstubs(t *testing.T) { } func TestDroidstubsWithSystemModules(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` droidstubs { name: "stubs-source-system-modules", @@ -1326,6 +1347,7 @@ func checkSystemModulesUseByDroidstubs(t *testing.T, ctx *android.TestContext, m } func TestJarGenrules(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_library { name: "foo", @@ -1380,6 +1402,7 @@ func TestJarGenrules(t *testing.T) { } func TestExcludeFileGroupInSrcs(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_library { name: "foo", @@ -1406,6 +1429,7 @@ func TestExcludeFileGroupInSrcs(t *testing.T) { } func TestJavaLibrary(t *testing.T) { + t.Parallel() config := testConfig(nil, "", map[string][]byte{ "libcore/Android.bp": []byte(` java_library { @@ -1443,6 +1467,7 @@ func TestJavaImport(t *testing.T) { } func TestJavaSdkLibrary(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` droiddoc_exported_dir { name: "droiddoc-templates-sdk", @@ -1581,6 +1606,7 @@ func TestJavaSdkLibrary(t *testing.T) { } func TestJavaSdkLibrary_DoNotAccessImplWhenItIsNotBuilt(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_sdk_library { name: "foo", @@ -1606,6 +1632,7 @@ func TestJavaSdkLibrary_DoNotAccessImplWhenItIsNotBuilt(t *testing.T) { } func TestJavaSdkLibrary_UseSourcesFromAnotherSdkLibrary(t *testing.T) { + t.Parallel() testJava(t, ` java_sdk_library { name: "foo", @@ -1624,6 +1651,7 @@ func TestJavaSdkLibrary_UseSourcesFromAnotherSdkLibrary(t *testing.T) { } func TestJavaSdkLibrary_AccessOutputFiles_MissingScope(t *testing.T) { + t.Parallel() testJavaError(t, `"foo" does not provide api scope system`, ` java_sdk_library { name: "foo", @@ -1642,6 +1670,7 @@ func TestJavaSdkLibrary_AccessOutputFiles_MissingScope(t *testing.T) { } func TestJavaSdkLibrary_Deps(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_sdk_library { name: "sdklib", @@ -1664,6 +1693,7 @@ func TestJavaSdkLibrary_Deps(t *testing.T) { } func TestJavaSdkLibraryImport_AccessOutputFiles(t *testing.T) { + t.Parallel() testJava(t, ` java_sdk_library_import { name: "foo", @@ -1687,6 +1717,7 @@ func TestJavaSdkLibraryImport_AccessOutputFiles(t *testing.T) { } func TestJavaSdkLibraryImport_AccessOutputFiles_Invalid(t *testing.T) { + t.Parallel() bp := ` java_sdk_library_import { name: "foo", @@ -1735,6 +1766,7 @@ func TestJavaSdkLibraryImport_AccessOutputFiles_Invalid(t *testing.T) { } func TestJavaSdkLibrary_InvalidScopes(t *testing.T) { + t.Parallel() testJavaError(t, `module "foo": enabled api scope "system" depends on disabled scope "public"`, ` java_sdk_library { name: "foo", @@ -1753,6 +1785,7 @@ func TestJavaSdkLibrary_InvalidScopes(t *testing.T) { } func TestJavaSdkLibrary_SdkVersion_ForScope(t *testing.T) { + t.Parallel() testJava(t, ` java_sdk_library { name: "foo", @@ -1767,6 +1800,7 @@ func TestJavaSdkLibrary_SdkVersion_ForScope(t *testing.T) { } func TestJavaSdkLibrary_ModuleLib(t *testing.T) { + t.Parallel() testJava(t, ` java_sdk_library { name: "foo", @@ -1783,6 +1817,7 @@ func TestJavaSdkLibrary_ModuleLib(t *testing.T) { } func TestJavaSdkLibrary_SystemServer(t *testing.T) { + t.Parallel() testJava(t, ` java_sdk_library { name: "foo", @@ -1799,6 +1834,7 @@ func TestJavaSdkLibrary_SystemServer(t *testing.T) { } func TestJavaSdkLibrary_MissingScope(t *testing.T) { + t.Parallel() testJavaError(t, `requires api scope module-lib from foo but it only has \[\] available`, ` java_sdk_library { name: "foo", @@ -1818,6 +1854,7 @@ func TestJavaSdkLibrary_MissingScope(t *testing.T) { } func TestJavaSdkLibrary_FallbackScope(t *testing.T) { + t.Parallel() testJava(t, ` java_sdk_library { name: "foo", @@ -1838,6 +1875,7 @@ func TestJavaSdkLibrary_FallbackScope(t *testing.T) { } func TestJavaSdkLibrary_DefaultToStubs(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_sdk_library { name: "foo", @@ -1913,6 +1951,7 @@ func (ctx *mockContext) PropertyErrorf(property, format string, args ...interfac } func TestCompilerFlags(t *testing.T) { + t.Parallel() for _, testCase := range compilerFlagsTestCases { ctx := &mockContext{result: true} CheckKotlincFlags(ctx, []string{testCase.in}) @@ -1943,6 +1982,7 @@ func checkPatchModuleFlag(t *testing.T, ctx *android.TestContext, moduleName str } func TestPatchModule(t *testing.T) { + t.Parallel() t.Run("Java language level 8", func(t *testing.T) { // Test with legacy javac -source 1.8 -target 1.8 bp := ` @@ -2008,6 +2048,7 @@ func TestPatchModule(t *testing.T) { } func TestJavaSystemModules(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_system_modules { name: "system-modules", @@ -2042,6 +2083,7 @@ func TestJavaSystemModules(t *testing.T) { } func TestJavaSystemModulesImport(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_system_modules_import { name: "system-modules", @@ -2072,6 +2114,7 @@ func TestJavaSystemModulesImport(t *testing.T) { } func TestJavaLibraryWithSystemModules(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_library { name: "lib-with-source-system-modules", @@ -2128,6 +2171,7 @@ func checkBootClasspathForSystemModule(t *testing.T, ctx *android.TestContext, m } func TestAidlExportIncludeDirsFromImports(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_library { name: "foo", @@ -2152,6 +2196,7 @@ func TestAidlExportIncludeDirsFromImports(t *testing.T) { } func TestDataNativeBinaries(t *testing.T) { + t.Parallel() ctx, config := testJava(t, ` java_test_host { name: "foo", diff --git a/java/jdeps_test.go b/java/jdeps_test.go index 874d1d7c0..46e72967c 100644 --- a/java/jdeps_test.go +++ b/java/jdeps_test.go @@ -22,6 +22,7 @@ import ( ) func TestCollectJavaLibraryPropertiesAddLibsDeps(t *testing.T) { + t.Parallel() expected := []string{"Foo", "Bar"} module := LibraryFactory().(*Library) module.properties.Libs = append(module.properties.Libs, expected...) @@ -35,6 +36,7 @@ func TestCollectJavaLibraryPropertiesAddLibsDeps(t *testing.T) { } func TestCollectJavaLibraryPropertiesAddStaticLibsDeps(t *testing.T) { + t.Parallel() expected := []string{"Foo", "Bar"} module := LibraryFactory().(*Library) module.properties.Static_libs = append(module.properties.Static_libs, expected...) @@ -48,6 +50,7 @@ func TestCollectJavaLibraryPropertiesAddStaticLibsDeps(t *testing.T) { } func TestCollectJavaLibraryPropertiesAddScrs(t *testing.T) { + t.Parallel() expected := []string{"Foo", "Bar"} module := LibraryFactory().(*Library) module.expandIDEInfoCompiledSrcs = append(module.expandIDEInfoCompiledSrcs, expected...) @@ -61,6 +64,7 @@ func TestCollectJavaLibraryPropertiesAddScrs(t *testing.T) { } func TestCollectJavaLibraryPropertiesAddAidlIncludeDirs(t *testing.T) { + t.Parallel() expected := []string{"Foo", "Bar"} module := LibraryFactory().(*Library) module.deviceProperties.Aidl.Include_dirs = append(module.deviceProperties.Aidl.Include_dirs, expected...) @@ -74,6 +78,7 @@ func TestCollectJavaLibraryPropertiesAddAidlIncludeDirs(t *testing.T) { } func TestCollectJavaLibraryPropertiesAddJarjarRules(t *testing.T) { + t.Parallel() expected := "Jarjar_rules.txt" module := LibraryFactory().(*Library) module.expandJarjarRules = android.PathForTesting(expected) diff --git a/java/kotlin_test.go b/java/kotlin_test.go index 60ca1c476..530f7fe5c 100644 --- a/java/kotlin_test.go +++ b/java/kotlin_test.go @@ -22,6 +22,7 @@ import ( ) func TestKotlin(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_library { name: "foo", @@ -84,6 +85,7 @@ func TestKotlin(t *testing.T) { } func TestKapt(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_library { name: "foo", @@ -163,6 +165,7 @@ func TestKapt(t *testing.T) { } func TestKaptEncodeFlags(t *testing.T) { + t.Parallel() // Compares the kaptEncodeFlags against the results of the example implementation at // https://kotlinlang.org/docs/reference/kapt.html#apjavac-options-encoding tests := []struct { diff --git a/java/plugin_test.go b/java/plugin_test.go index c7913d3db..3eb021514 100644 --- a/java/plugin_test.go +++ b/java/plugin_test.go @@ -20,6 +20,7 @@ import ( ) func TestNoPlugin(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_library { name: "foo", @@ -44,6 +45,7 @@ func TestNoPlugin(t *testing.T) { } func TestPlugin(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_library { name: "foo", @@ -83,6 +85,7 @@ func TestPlugin(t *testing.T) { } func TestPluginGeneratesApi(t *testing.T) { + t.Parallel() ctx, _ := testJava(t, ` java_library { name: "foo", diff --git a/java/sdk_test.go b/java/sdk_test.go index 776069dc9..374da11a4 100644 --- a/java/sdk_test.go +++ b/java/sdk_test.go @@ -27,6 +27,7 @@ import ( ) func TestClasspath(t *testing.T) { + t.Parallel() var classpathTestcases = []struct { name string unbundled bool |