From 323dc60712491c71ccdc5363c42df61f0a192487 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 18 Sep 2020 14:25:31 -0700 Subject: 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 --- rust/rust_test.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'rust/rust_test.go') diff --git a/rust/rust_test.go b/rust/rust_test.go index 4842a4ca8..26e943a42 100644 --- a/rust/rust_test.go +++ b/rust/rust_test.go @@ -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", -- cgit v1.2.3-59-g8ed1b