@@ -19,17 +19,18 @@ GO_PKGS := $(shell go list ./... | grep -v -e '.pb.go')
19
19
GO_TEST_PKGS := $(shell go list -f='{{if or .TestGoFiles .XTestGoFiles}}{{.ImportPath}}{{end}}' ./...)
20
20
21
21
export GOTESTSUM_FORMAT =pkgname-and-test-fails
22
- GO_TEST ?= ${TOOLS_BIN}/gotestsum --
22
+ GO_TEST ?= ${TOOLS_BIN}/gotestsum --format=standard-verbose --
23
23
GO_TEST_FUNC ?= .
24
24
GO_TEST_FLAGS ?=
25
25
GO_BENCH_FUNC ?= .
26
26
GO_BENCH_FLAGS ?= -benchmem
27
27
GO_LINT_FLAGS ?=
28
28
29
29
CGO_ENABLED ?= 0
30
- GO_BUILDTAGS =osusergo netgo static static_build
30
+ GO_BUILDTAGS =osusergo netgo static
31
31
GO_LDFLAGS =-s -w "-extldflags=-static"
32
32
GO_FLAGS ?= -tags='$(subst $(space ) ,$(comma ) ,${GO_BUILDTAGS}) ' -ldflags='${GO_LDFLAGS}' -installsuffix=netgo
33
+ GO_FLAGS_TOOLS ?= -tags='$(subst $(space ) ,$(comma ) ,${GO_BUILDTAGS}) ' -ldflags='-s -w' -installsuffix=netgo
33
34
34
35
# ----------------------------------------------------------------------------
35
36
# defines
@@ -50,17 +51,18 @@ tools: ${TOOLS_BIN} ## Install tools
50
51
${TOOLS_BIN} :
51
52
cd tools; \
52
53
for t in $$ (go list -f ' {{ join .Imports " " }}' -tags=tools); do \
53
- GOBIN=${TOOLS_BIN} go install -v -mod=mod " $$ {t}" ; \
54
+ GOBIN=${TOOLS_BIN} CGO_ENABLED=0 go install -v -mod=mod ${GO_FLAGS_TOOLS} " $$ {t}" ; \
54
55
done
55
56
56
57
# #@ test, bench, coverage
57
58
58
59
.PHONY : test
59
60
test : ${TOOLS_BIN}
60
61
test : CGO_ENABLED=1
62
+ test : GO_FLAGS=-tags='$(subst $(space ) ,$(comma ) ,${GO_BUILDTAGS}) '
61
63
test : # # Runs package test including race condition.
62
64
$(call target)
63
- CGO_ENABLED=$(CGO_ENABLED ) $(GO_TEST ) -v - race -count 1 -run=$(GO_TEST_FUNC ) $(strip ${GO_FLAGS}) $(GO_TEST_PKGS )
65
+ CGO_ENABLED=$(CGO_ENABLED ) $(GO_TEST ) -race -count 1 -run=$(GO_TEST_FUNC ) $(strip ${GO_FLAGS}) $(GO_TEST_PKGS )
64
66
65
67
.PHONY : test/gojay
66
68
test/gojay : GO_BUILDTAGS+=gojay
0 commit comments