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:
@@ -102,6 +102,7 @@ func testPrebuiltEtcError(t *testing.T, pattern, bp string) {
|
||||
t.Fatalf("missing expected error %q (0 errors are returned)", pattern)
|
||||
}
|
||||
func TestPrebuiltEtcVariants(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx, _ := testPrebuiltEtc(t, `
|
||||
prebuilt_etc {
|
||||
name: "foo.conf",
|
||||
@@ -136,6 +137,7 @@ func TestPrebuiltEtcVariants(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPrebuiltEtcOutputPath(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx, _ := testPrebuiltEtc(t, `
|
||||
prebuilt_etc {
|
||||
name: "foo.conf",
|
||||
@@ -151,6 +153,7 @@ func TestPrebuiltEtcOutputPath(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPrebuiltEtcGlob(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx, _ := testPrebuiltEtc(t, `
|
||||
prebuilt_etc {
|
||||
name: "my_foo",
|
||||
@@ -175,6 +178,7 @@ func TestPrebuiltEtcGlob(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPrebuiltEtcAndroidMk(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx, config := testPrebuiltEtc(t, `
|
||||
prebuilt_etc {
|
||||
name: "foo",
|
||||
@@ -211,6 +215,7 @@ func TestPrebuiltEtcAndroidMk(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPrebuiltEtcRelativeInstallPathInstallDirPath(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx, _ := testPrebuiltEtc(t, `
|
||||
prebuilt_etc {
|
||||
name: "foo.conf",
|
||||
@@ -227,6 +232,7 @@ func TestPrebuiltEtcRelativeInstallPathInstallDirPath(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPrebuiltEtcCannotSetRelativeInstallPathAndSubDir(t *testing.T) {
|
||||
t.Parallel()
|
||||
testPrebuiltEtcError(t, "relative_install_path is set. Cannot set sub_dir", `
|
||||
prebuilt_etc {
|
||||
name: "foo.conf",
|
||||
@@ -238,6 +244,7 @@ func TestPrebuiltEtcCannotSetRelativeInstallPathAndSubDir(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPrebuiltEtcHost(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx, _ := testPrebuiltEtc(t, `
|
||||
prebuilt_etc_host {
|
||||
name: "foo.conf",
|
||||
@@ -253,6 +260,7 @@ func TestPrebuiltEtcHost(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPrebuiltUserShareInstallDirPath(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx, _ := testPrebuiltEtc(t, `
|
||||
prebuilt_usr_share {
|
||||
name: "foo.conf",
|
||||
@@ -269,6 +277,7 @@ func TestPrebuiltUserShareInstallDirPath(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPrebuiltUserShareHostInstallDirPath(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx, config := testPrebuiltEtc(t, `
|
||||
prebuilt_usr_share_host {
|
||||
name: "foo.conf",
|
||||
@@ -286,6 +295,7 @@ func TestPrebuiltUserShareHostInstallDirPath(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPrebuiltFontInstallDirPath(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx, _ := testPrebuiltEtc(t, `
|
||||
prebuilt_font {
|
||||
name: "foo.conf",
|
||||
@@ -301,6 +311,7 @@ func TestPrebuiltFontInstallDirPath(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPrebuiltFirmwareDirPath(t *testing.T) {
|
||||
t.Parallel()
|
||||
targetPath := buildDir + "/target/product/test_device"
|
||||
tests := []struct {
|
||||
description string
|
||||
@@ -337,6 +348,7 @@ func TestPrebuiltFirmwareDirPath(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPrebuiltDSPDirPath(t *testing.T) {
|
||||
t.Parallel()
|
||||
targetPath := filepath.Join(buildDir, "/target/product/test_device")
|
||||
tests := []struct {
|
||||
description string
|
||||
|
Reference in New Issue
Block a user