Skip to content

Commit

Permalink
Use gotest in makefile (if present)
Browse files Browse the repository at this point in the history
  • Loading branch information
gavv committed Jun 11, 2024
1 parent 1cf9b61 commit 856a90c
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
GO111MODULE := on
export GO111MODULE

ifeq ($(shell uname -s),Linux)
TERM := xterm
export TERM
endif

ifneq ($(shell which gotest),)
gotest := gotest
else
gotest := go test
endif

all: gen build lint testall

gen:
cd roc && go generate

build:
cd roc && go build .
cd roc && go test . -run xxx
cd roc && $(gotest) -run none .

lint:
cd roc && golangci-lint run .

test:
cd roc && go test . -count=1 .
cd roc && $(gotest) -count=1 .

testall:
cd roc && go test . -count=1 .
cd roc && go test -count=1 -race .
cd roc && GOEXPERIMENT=cgocheck2 go build && go test -count=1 .
cd roc && $(gotest) -count=1 .
cd roc && $(gotest) -count=1 -race .
cd roc && GOEXPERIMENT=cgocheck2 go build && $(gotest) -count=1 .

clean:
cd roc && go clean -cache -testcache
Expand Down

0 comments on commit 856a90c

Please sign in to comment.