Make lots of tests run in parallel
Putting t.Parallel() in each test makes them run in parallel. Additional t.Parallel() could be added to each subtest, although that requires making a local copy of the loop variable for table driven tests. Test: m checkbuild Change-Id: I5d9869ead441093f4d7c5757f2447385333a95a4
This commit is contained in:
@@ -40,6 +40,7 @@ func testSdkWithCc(t *testing.T, bp string) *testSdkResult {
|
||||
// Contains tests for SDK members provided by the cc package.
|
||||
|
||||
func TestSingleDeviceOsAssumption(t *testing.T) {
|
||||
t.Parallel()
|
||||
// Mock a module with DeviceSupported() == true.
|
||||
s := &sdk{}
|
||||
android.InitAndroidArchModule(s, android.DeviceSupported, android.MultilibCommon)
|
||||
@@ -54,6 +55,7 @@ func TestSingleDeviceOsAssumption(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSdkIsCompileMultilibBoth(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
sdk {
|
||||
name: "mysdk",
|
||||
@@ -84,6 +86,7 @@ func TestSdkIsCompileMultilibBoth(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSdkCompileMultilibOverride(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
sdk {
|
||||
name: "mysdk",
|
||||
@@ -175,6 +178,7 @@ sdk_snapshot {
|
||||
}
|
||||
|
||||
func TestBasicSdkWithCc(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
sdk {
|
||||
name: "mysdk",
|
||||
@@ -281,6 +285,7 @@ func TestBasicSdkWithCc(t *testing.T) {
|
||||
|
||||
// Make sure the sdk can use host specific cc libraries static/shared and both.
|
||||
func TestHostSdkWithCc(t *testing.T) {
|
||||
t.Parallel()
|
||||
testSdkWithCc(t, `
|
||||
sdk {
|
||||
name: "mysdk",
|
||||
@@ -304,6 +309,7 @@ func TestHostSdkWithCc(t *testing.T) {
|
||||
|
||||
// Make sure the sdk can use cc libraries static/shared and both.
|
||||
func TestSdkWithCc(t *testing.T) {
|
||||
t.Parallel()
|
||||
testSdkWithCc(t, `
|
||||
sdk {
|
||||
name: "mysdk",
|
||||
@@ -334,6 +340,7 @@ func TestSdkWithCc(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSnapshotWithObject(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
sdk {
|
||||
name: "mysdk",
|
||||
@@ -405,6 +412,7 @@ sdk_snapshot {
|
||||
}
|
||||
|
||||
func TestSnapshotWithCcDuplicateHeaders(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
sdk {
|
||||
name: "mysdk",
|
||||
@@ -446,6 +454,7 @@ include/Test.h -> include/include/Test.h
|
||||
// handling is tested with the sanitize clauses (but note there's a lot of
|
||||
// built-in logic in sanitize.go that can affect those flags).
|
||||
func TestSnapshotWithCcSharedLibraryCommonProperties(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
sdk {
|
||||
name: "mysdk",
|
||||
@@ -559,6 +568,7 @@ arm64/include/Arm64Test.h -> arm64/include/arm64/include/Arm64Test.h
|
||||
}
|
||||
|
||||
func TestSnapshotWithCcBinary(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
module_exports {
|
||||
name: "mymodule_exports",
|
||||
@@ -623,6 +633,7 @@ module_exports_snapshot {
|
||||
}
|
||||
|
||||
func TestMultipleHostOsTypesSnapshotWithCcBinary(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
module_exports {
|
||||
name: "myexports",
|
||||
@@ -749,6 +760,7 @@ module_exports_snapshot {
|
||||
}
|
||||
|
||||
func TestSnapshotWithSingleHostOsType(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx, config := testSdkContext(`
|
||||
cc_defaults {
|
||||
name: "mydefaults",
|
||||
@@ -912,6 +924,7 @@ module_exports_snapshot {
|
||||
// Test that we support the necessary flags for the linker binary, which is
|
||||
// special in several ways.
|
||||
func TestSnapshotWithCcStaticNocrtBinary(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
module_exports {
|
||||
name: "mymodule_exports",
|
||||
@@ -1014,6 +1027,7 @@ module_exports_snapshot {
|
||||
}
|
||||
|
||||
func TestSnapshotWithCcSharedLibrary(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
sdk {
|
||||
name: "mysdk",
|
||||
@@ -1107,6 +1121,7 @@ include/Test.h -> include/include/Test.h
|
||||
}
|
||||
|
||||
func TestSnapshotWithCcSharedLibrarySharedLibs(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
sdk {
|
||||
name: "mysdk",
|
||||
@@ -1301,6 +1316,7 @@ sdk_snapshot {
|
||||
}
|
||||
|
||||
func TestHostSnapshotWithCcSharedLibrary(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
sdk {
|
||||
name: "mysdk",
|
||||
@@ -1418,6 +1434,7 @@ include/Test.h -> include/include/Test.h
|
||||
}
|
||||
|
||||
func TestMultipleHostOsTypesSnapshotWithCcSharedLibrary(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
sdk {
|
||||
name: "mysdk",
|
||||
@@ -1543,6 +1560,7 @@ sdk_snapshot {
|
||||
}
|
||||
|
||||
func TestSnapshotWithCcStaticLibrary(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
module_exports {
|
||||
name: "myexports",
|
||||
@@ -1627,6 +1645,7 @@ include/Test.h -> include/include/Test.h
|
||||
}
|
||||
|
||||
func TestHostSnapshotWithCcStaticLibrary(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
module_exports {
|
||||
name: "myexports",
|
||||
@@ -1741,6 +1760,7 @@ include/Test.h -> include/include/Test.h
|
||||
}
|
||||
|
||||
func TestSnapshotWithCcLibrary(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
module_exports {
|
||||
name: "myexports",
|
||||
@@ -1838,6 +1858,7 @@ include/Test.h -> include/include/Test.h
|
||||
}
|
||||
|
||||
func TestHostSnapshotWithMultiLib64(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
module_exports {
|
||||
name: "myexports",
|
||||
@@ -1945,6 +1966,7 @@ include/Test.h -> include/include/Test.h
|
||||
}
|
||||
|
||||
func TestSnapshotWithCcHeadersLibrary(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
sdk {
|
||||
name: "mysdk",
|
||||
@@ -1993,6 +2015,7 @@ include/Test.h -> include/include/Test.h
|
||||
}
|
||||
|
||||
func TestHostSnapshotWithCcHeadersLibrary(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
sdk {
|
||||
name: "mysdk",
|
||||
@@ -2075,6 +2098,7 @@ include/Test.h -> include/include/Test.h
|
||||
}
|
||||
|
||||
func TestDeviceAndHostSnapshotWithCcHeadersLibrary(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
sdk {
|
||||
name: "mysdk",
|
||||
@@ -2170,6 +2194,7 @@ include-host/HostTest.h -> linux_glibc/include/include-host/HostTest.h
|
||||
}
|
||||
|
||||
func TestSystemSharedLibPropagation(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
sdk {
|
||||
name: "mysdk",
|
||||
@@ -2407,6 +2432,7 @@ sdk_snapshot {
|
||||
}
|
||||
|
||||
func TestStubsLibrary(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
sdk {
|
||||
name: "mysdk",
|
||||
@@ -2485,6 +2511,7 @@ sdk_snapshot {
|
||||
}
|
||||
|
||||
func TestDeviceAndHostSnapshotWithStubsLibrary(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
sdk {
|
||||
name: "mysdk",
|
||||
@@ -2601,6 +2628,7 @@ sdk_snapshot {
|
||||
}
|
||||
|
||||
func TestUniqueHostSoname(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := testSdkWithCc(t, `
|
||||
sdk {
|
||||
name: "mysdk",
|
||||
|
Reference in New Issue
Block a user