From f2f0059307e3ff555858b2d51493187f467c17e2 Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Thu, 19 Jan 2012 16:17:44 +0400 Subject: [PATCH] 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 --- src/pkg/math/rand/rand_test.go | 10 ++++++++-- 1 file 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) } -- 2.50.0