cmd/go: only run -race test if -race works

Updates #23694

Change-Id: I5fdad8cceacb8bbc85ca2661eb6482aa80343656
Reviewed-on: https://go-review.googlesource.com/92075
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Ian Lance Taylor 2018-02-05 12:19:08 -08:00 committed by Brad Fitzpatrick
parent 4558321eb2
commit 5952317637

View file

@ -5696,6 +5696,8 @@ func TestAtomicCoverpkgAll(t *testing.T) {
tg.tempFile("src/x/x.go", `package x; import _ "sync/atomic"; func F() {}`)
tg.tempFile("src/x/x_test.go", `package x; import "testing"; func TestF(t *testing.T) { F() }`)
tg.setenv("GOPATH", tg.path("."))
tg.run("test", "-coverpkg=all", "-race", "x")
tg.run("test", "-coverpkg=all", "-covermode=atomic", "x")
if canRace {
tg.run("test", "-coverpkg=all", "-race", "x")
}
}