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
diff --git a/android/namespace_test.go b/android/namespace_test.go
index 66c0d89..5cce3e4 100644
--- a/android/namespace_test.go
+++ b/android/namespace_test.go
@@ -24,6 +24,7 @@
)
func TestDependingOnModuleInSameNamespace(t *testing.T) {
+ t.Parallel()
ctx := setupTest(t,
map[string]string{
"dir1": `
@@ -48,6 +49,7 @@
}
func TestDependingOnModuleInRootNamespace(t *testing.T) {
+ t.Parallel()
ctx := setupTest(t,
map[string]string{
".": `
@@ -70,6 +72,7 @@
}
func TestImplicitlyImportRootNamespace(t *testing.T) {
+ t.Parallel()
_ = setupTest(t,
map[string]string{
".": `
@@ -92,6 +95,7 @@
}
func TestDependingOnBlueprintModuleInRootNamespace(t *testing.T) {
+ t.Parallel()
_ = setupTest(t,
map[string]string{
".": `
@@ -114,6 +118,7 @@
}
func TestDependingOnModuleInImportedNamespace(t *testing.T) {
+ t.Parallel()
ctx := setupTest(t,
map[string]string{
"dir1": `
@@ -143,6 +148,7 @@
}
func TestDependingOnModuleInNonImportedNamespace(t *testing.T) {
+ t.Parallel()
_, errs := setupTestExpectErrs(
map[string]string{
"dir1": `
@@ -183,6 +189,7 @@
}
func TestDependingOnModuleByFullyQualifiedReference(t *testing.T) {
+ t.Parallel()
ctx := setupTest(t,
map[string]string{
"dir1": `
@@ -210,6 +217,7 @@
}
func TestSameNameInTwoNamespaces(t *testing.T) {
+ t.Parallel()
ctx := setupTest(t,
map[string]string{
"dir1": `
@@ -260,6 +268,7 @@
}
func TestSearchOrder(t *testing.T) {
+ t.Parallel()
ctx := setupTest(t,
map[string]string{
"dir1": `
@@ -348,6 +357,7 @@
}
func TestTwoNamespacesCanImportEachOther(t *testing.T) {
+ t.Parallel()
_ = setupTest(t,
map[string]string{
"dir1": `
@@ -378,6 +388,7 @@
}
func TestImportingNonexistentNamespace(t *testing.T) {
+ t.Parallel()
_, errs := setupTestExpectErrs(
map[string]string{
"dir1": `
@@ -402,6 +413,7 @@
}
func TestNamespacesDontInheritParentNamespaces(t *testing.T) {
+ t.Parallel()
_, errs := setupTestExpectErrs(
map[string]string{
"dir1": `
@@ -433,6 +445,7 @@
}
func TestModulesDoReceiveParentNamespace(t *testing.T) {
+ t.Parallel()
_ = setupTest(t,
map[string]string{
"dir1": `
@@ -455,6 +468,7 @@
}
func TestNamespaceImportsNotTransitive(t *testing.T) {
+ t.Parallel()
_, errs := setupTestExpectErrs(
map[string]string{
"dir1": `
@@ -496,6 +510,7 @@
}
func TestTwoNamepacesInSameDir(t *testing.T) {
+ t.Parallel()
_, errs := setupTestExpectErrs(
map[string]string{
"dir1": `
@@ -516,6 +531,7 @@
}
func TestNamespaceNotAtTopOfFile(t *testing.T) {
+ t.Parallel()
_, errs := setupTestExpectErrs(
map[string]string{
"dir1": `
@@ -537,6 +553,7 @@
}
func TestTwoModulesWithSameNameInSameNamespace(t *testing.T) {
+ t.Parallel()
_, errs := setupTestExpectErrs(
map[string]string{
"dir1": `
@@ -562,6 +579,7 @@
}
func TestDeclaringNamespaceInNonAndroidBpFile(t *testing.T) {
+ t.Parallel()
_, errs := setupTestFromFiles(
map[string][]byte{
"Android.bp": []byte(`
@@ -585,6 +603,7 @@
// so that the generated .ninja file will have consistent names
func TestConsistentNamespaceNames(t *testing.T) {
+ t.Parallel()
ctx := setupTest(t,
map[string]string{
"dir1": "soong_namespace{}",
@@ -604,6 +623,7 @@
// so that the generated .ninja file will have consistent names
func TestRename(t *testing.T) {
+ t.Parallel()
_ = setupTest(t,
map[string]string{
"dir1": `