diff options
| author | Brad Fitzpatrick <bradfitz@golang.org> | 2016-11-16 19:08:25 +0000 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2016-11-16 19:22:53 +0000 |
| commit | d8b14c524303f8d28bc5b496e918cfbb2758cbc5 (patch) | |
| tree | cfe7a8d2dd58853c37aeeff64d3616f4d808df10 /src | |
| parent | 68fda1888e8026aef96590ac634bc35d4c71b6e0 (diff) | |
| download | go-d8b14c524303f8d28bc5b496e918cfbb2758cbc5.tar.xz | |
math/rand: make floating point tests shorter on mips and mipsle
Like GOARM=5 does.
Fixes #17944
Change-Id: Ica2a54a90fbd4a29471d1c6009ace2fcc5e82a73
Reviewed-on: https://go-review.googlesource.com/33326
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/math/rand/rand_test.go | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/math/rand/rand_test.go b/src/math/rand/rand_test.go index 6f312792d0..bf509e06be 100644 --- a/src/math/rand/rand_test.go +++ b/src/math/rand/rand_test.go @@ -328,13 +328,26 @@ func TestExpTables(t *testing.T) { } } +func hasSlowFloatingPoint() bool { + switch runtime.GOARCH { + case "arm": + return os.Getenv("GOARM") == "5" + case "mips", "mipsle", "mips64", "mips64le": + // Be conservative and assume that all mips boards + // have emulated floating point. + // TODO: detect what it actually has. + return true + } + return false +} + func TestFloat32(t *testing.T) { // For issue 6721, the problem came after 7533753 calls, so check 10e6. num := int(10e6) // But do the full amount only on builders (not locally). // But ARM5 floating point emulation is slow (Issue 10749), so // do less for that builder: - if testing.Short() && (testenv.Builder() == "" || runtime.GOARCH == "arm" && os.Getenv("GOARM") == "5") { + if testing.Short() && (testenv.Builder() == "" || hasSlowFloatingPoint()) { num /= 100 // 1.72 seconds instead of 172 seconds } |
