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:
@@ -135,6 +135,7 @@ func testRustError(t *testing.T, pattern string, bp string) {
|
||||
|
||||
// Test that we can extract the link path from a lib path.
|
||||
func TestLinkPathFromFilePath(t *testing.T) {
|
||||
t.Parallel()
|
||||
barPath := android.PathForTesting("out/soong/.intermediates/external/libbar/libbar/linux_glibc_x86_64_shared/libbar.so")
|
||||
libName := linkPathFromFilePath(barPath)
|
||||
expectedResult := "out/soong/.intermediates/external/libbar/libbar/linux_glibc_x86_64_shared/"
|
||||
@@ -146,6 +147,7 @@ func TestLinkPathFromFilePath(t *testing.T) {
|
||||
|
||||
// Test to make sure dependencies are being picked up correctly.
|
||||
func TestDepsTracking(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx := testRust(t, `
|
||||
rust_ffi_host_static {
|
||||
name: "libstatic",
|
||||
@@ -207,6 +209,7 @@ func TestDepsTracking(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSourceProviderDeps(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx := testRust(t, `
|
||||
rust_binary {
|
||||
name: "fizz-buzz-dep",
|
||||
@@ -294,6 +297,7 @@ func TestSourceProviderDeps(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSourceProviderTargetMismatch(t *testing.T) {
|
||||
t.Parallel()
|
||||
// This might error while building the dependency tree or when calling depsToPaths() depending on the lunched
|
||||
// target, which results in two different errors. So don't check the error, just confirm there is one.
|
||||
testRustError(t, ".*", `
|
||||
@@ -316,6 +320,7 @@ func TestSourceProviderTargetMismatch(t *testing.T) {
|
||||
|
||||
// Test to make sure proc_macros use host variants when building device modules.
|
||||
func TestProcMacroDeviceDeps(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx := testRust(t, `
|
||||
rust_library_host_rlib {
|
||||
name: "libbar",
|
||||
@@ -343,6 +348,7 @@ func TestProcMacroDeviceDeps(t *testing.T) {
|
||||
|
||||
// Test that no_stdlibs suppresses dependencies on rust standard libraries
|
||||
func TestNoStdlibs(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx := testRust(t, `
|
||||
rust_binary {
|
||||
name: "fizz-buzz",
|
||||
@@ -358,6 +364,7 @@ func TestNoStdlibs(t *testing.T) {
|
||||
|
||||
// Test that libraries provide both 32-bit and 64-bit variants.
|
||||
func TestMultilib(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx := testRust(t, `
|
||||
rust_library_rlib {
|
||||
name: "libfoo",
|
||||
|
Reference in New Issue
Block a user