From 595231763754e5fc3a8431a31f3ae893fd7d2d57 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 5 Feb 2018 12:19:08 -0800 Subject: [PATCH] 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 Reviewed-by: Brad Fitzpatrick --- src/cmd/go/go_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index 9009ec92e1..7db62da34e 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -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") + } } -- 2.50.0