Commit 59523176 authored by Ian Lance Taylor's avatar Ian Lance Taylor Committed by Brad Fitzpatrick

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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 4558321e
...@@ -5696,6 +5696,8 @@ func TestAtomicCoverpkgAll(t *testing.T) { ...@@ -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.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.tempFile("src/x/x_test.go", `package x; import "testing"; func TestF(t *testing.T) { F() }`)
tg.setenv("GOPATH", tg.path(".")) tg.setenv("GOPATH", tg.path("."))
tg.run("test", "-coverpkg=all", "-race", "x")
tg.run("test", "-coverpkg=all", "-covermode=atomic", "x") tg.run("test", "-coverpkg=all", "-covermode=atomic", "x")
if canRace {
tg.run("test", "-coverpkg=all", "-race", "x")
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment