diff options
author | Dmitriy Vyukov <dvyukov@google.com> | 2012-01-19 16:17:44 +0400 |
---|---|---|
committer | Dmitriy Vyukov <dvyukov@google.com> | 2012-01-19 16:17:44 +0400 |
commit | f2f0059307e3ff555858b2d51493187f467c17e2 (patch) | |
tree | d9c06ff0ef7597f8b39eb6793d0845703cf28b71 | |
parent | 3358a5068a87bc25bd551698f4f0be7c5677168d (diff) | |
download | go-f2f0059307e3ff555858b2d51493187f467c17e2.tar.gz go-f2f0059307e3ff555858b2d51493187f467c17e2.zip |
math/rand: decrease test duration in short mode
TestNonStandardNormalValues runs 1.5s,
the change reduces it to 0.2s in short mode.
The problem is with slow machines, emulators and dynamic tools.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5540065
-rw-r--r-- | src/pkg/math/rand/rand_test.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/pkg/math/rand/rand_test.go b/src/pkg/math/rand/rand_test.go index 76215a978a..0ba8f98c49 100644 --- a/src/pkg/math/rand/rand_test.go +++ b/src/pkg/math/rand/rand_test.go @@ -131,8 +131,14 @@ func TestStandardNormalValues(t *testing.T) { } func TestNonStandardNormalValues(t *testing.T) { - for sd := 0.5; sd < 1000; sd *= 2 { - for m := 0.5; m < 1000; m *= 2 { + sdmax := 1000.0 + mmax := 1000.0 + if testing.Short() { + sdmax = 5 + mmax = 5 + } + for sd := 0.5; sd < sdmax; sd *= 2 { + for m := 0.5; m < mmax; m *= 2 { for _, seed := range testSeeds { testNormalDistribution(t, numTestSamples, m, sd, seed) } |