Makefile: Don't run go test with -race on Windows.

Running "go test -race" on Windows requires GCC, and it appears not all GCC
builds are compatible. Since we can't reliably determine whether the environment
has a good GCC for running the race detector, just don't enable it.

This resolves #1108.
This commit is contained in:
Qi Xiao 2020-08-18 21:32:26 +01:00
parent 821e414fc9
commit ce19bca599

View File

@ -12,9 +12,11 @@ buildall:
generate:
go generate ./...
# Run unit tests -- with race detection if the platform supports it.
# Run unit tests -- with race detection if the platform supports it. Go's
# Windows port supports race detection, but requires GCC, so we don't enable it
# there.
test:
if echo `go env GOOS GOARCH` | egrep -qx '(linux|freebsd|darwin|windows) amd64'; then \
if echo `go env GOOS GOARCH` | egrep -qx '(linux|freebsd|darwin) amd64'; then \
go test -race ./... ; \
else \
go test ./... ; \