summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2020-10-07 20:40:38 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-10-07 20:40:38 +0000
commit45fd6ace7e6dd7c588c6cf44aa5280de7621d39b (patch)
tree857807c39d6b518409837aec3dac65d28865d1a2 /java/java_test.go
parent43159bd1b7c99790d84fdedda09db3701d466f30 (diff)
parent323dc60712491c71ccdc5363c42df61f0a192487 (diff)
Merge "Make lots of tests run in parallel"
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go45
1 files changed, 45 insertions, 0 deletions
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",