summaryrefslogtreecommitdiff
path: root/rust/rust_test.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2020-09-18 14:25:31 -0700
committerColin Cross <ccross@android.com>2020-10-06 15:12:22 -0700
commit323dc60712491c71ccdc5363c42df61f0a192487 (patch)
tree5ba86007fb0f7d2536671cbc64e91b1eac304270 /rust/rust_test.go
parent56a8321c210bf73c7b9f177849ff4a6b6192d237 (diff)
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
Diffstat (limited to 'rust/rust_test.go')
-rw-r--r--rust/rust_test.go7
1 files changed, 7 insertions, 0 deletions
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",