From 54c1ffe5f30d20151ff307b57fcbee085d2b2b42 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Mon, 15 Feb 2016 11:33:24 +0100 Subject: [PATCH] Only test with -race on supported platforms (fixes #2765) --- build.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/build.go b/build.go index 265172f16..b6cb54db6 100644 --- a/build.go +++ b/build.go @@ -188,7 +188,18 @@ func setup() { func test(pkg string) { setBuildEnv() - runPrint("go", "test", "-short", "-race", "-timeout", "60s", pkg) + useRace := runtime.GOARCH == "amd64" + switch runtime.GOOS { + case "darwin", "linux", "freebsd", "windows": + default: + useRace = false + } + + if useRace { + runPrint("go", "test", "-short", "-race", "-timeout", "60s", pkg) + } else { + runPrint("go", "test", "-short", "-timeout", "60s", pkg) + } } func bench(pkg string) {