Skip to content

Commit

Permalink
Makefile: Don't run go test with -race on Windows.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
xiaq committed Aug 18, 2020
1 parent 821e414 commit ce19bca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./... ; \
Expand Down

0 comments on commit ce19bca

Please sign in to comment.