diff options
author | Brad Fitzpatrick <bradfitz@golang.org> | 2016-09-14 18:44:59 +0000 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2016-09-14 19:11:43 +0000 |
commit | 6f135bfd922cafd000497467c73cc03cfa788fa6 (patch) | |
tree | 56361775084f529d1f9d3a4e081c1ec80396a88e /src/math/big/arith_test.go | |
parent | 983e2fd4e6fecd78789384069c476eead4806d1b (diff) | |
download | go-6f135bfd922cafd000497467c73cc03cfa788fa6.tar.gz go-6f135bfd922cafd000497467c73cc03cfa788fa6.zip |
math/big: cut 2 minutes off race tests
No need to test so many sizes in race mode, especially for a package
which doesn't use goroutines.
Reduces test time from 2.5 minutes to 25 seconds.
Updates #17104
Change-Id: I7065b39273f82edece385c0d67b3f2d83d4934b8
Reviewed-on: https://go-review.googlesource.com/29163
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Diffstat (limited to 'src/math/big/arith_test.go')
-rw-r--r-- | src/math/big/arith_test.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/math/big/arith_test.go b/src/math/big/arith_test.go index 75862b4951..f2b3083000 100644 --- a/src/math/big/arith_test.go +++ b/src/math/big/arith_test.go @@ -6,10 +6,14 @@ package big import ( "fmt" + "internal/testenv" "math/rand" + "strings" "testing" ) +var isRaceBuilder = strings.HasSuffix(testenv.Builder(), "-race") + type funWW func(x, y, c Word) (z1, z0 Word) type argWW struct { x, y, c, z1, z0 Word @@ -123,6 +127,9 @@ var benchSizes = []int{1, 2, 3, 4, 5, 1e1, 1e2, 1e3, 1e4, 1e5} func BenchmarkAddVV(b *testing.B) { for _, n := range benchSizes { + if isRaceBuilder && n > 1e3 { + continue + } x := rndV(n) y := rndV(n) z := make([]Word, n) @@ -233,6 +240,9 @@ func TestFunVW(t *testing.T) { func BenchmarkAddVW(b *testing.B) { for _, n := range benchSizes { + if isRaceBuilder && n > 1e3 { + continue + } x := rndV(n) y := rndW() z := make([]Word, n) @@ -371,6 +381,9 @@ func TestMulAddWWW(t *testing.T) { func BenchmarkAddMulVVW(b *testing.B) { for _, n := range benchSizes { + if isRaceBuilder && n > 1e3 { + continue + } x := rndV(n) y := rndW() z := make([]Word, n) |