summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-09-17 14:05:38 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-09-17 14:07:06 -0400
commitb59cfff419bb12951a44c672b3462f59c7e0026b (patch)
treed2f1b3f27c287c76ddd142ae959398f7aa18fb6f
parentc4a530a64cf5128478ba912dacd07e719add5c79 (diff)
Makefile: "-race" doesn't work in i686, don't break the tests there
-rw-r--r--Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index f436ca6..873d745 100644
--- a/Makefile
+++ b/Makefile
@@ -90,8 +90,11 @@ $(outdir)/go/src/nshd/nshd_files/paths.go: $(var.)bindir $(var.)conf_file $(var.
$(outdir)/go/bin/nshd: $(outdir)/$(files.generate) $(outdir)/go/src/nshd/nshd_files/paths.go
files.out.all += $(outdir)/go/src/nshd/nshd_files/paths.go
+go_os_arch = $(word 4,$(shell go version))
+go_race_os_arch = $(shell go help build | sed -n '/^\s*-race/,/^\s*-/p'| grep -oE '[a-z0-9]+/[a-z0-9]+')
+go_test_flags = $(if $(filter $(go_os_arch),$(go_race_os_arch)),-race)
$(outdir)/check:
- GOPATH=$$PWD/go go test -race $$(GOPATH=$$PWD/go go list -f '{{.ImportPath}}{{"\n"}}{{join .Deps "\n"}}' $(bins_go) | sort -u | grep -e ^nshd -e '\.[^/]*/')
+ GOPATH=$$PWD/go go test $(go_test_flags) $$(GOPATH=$$PWD/go go list -f '{{.ImportPath}}{{"\n"}}{{join .Deps "\n"}}' $(bins_go) | sort -u | grep -e ^nshd -e '\.[^/]*/')
.PHONY: $(outdir)/check
at.targets += $(outdir)/check