blob: 2968aaa61dd3d0d08ecd953cbfe8b2ee152c76eb [file] [log] [blame]
khenaidooab1f7bd2019-11-14 14:00:27 -05001BRANCH=`git rev-parse --abbrev-ref HEAD`
2COMMIT=`git rev-parse --short HEAD`
3GOLDFLAGS="-X main.branch $(BRANCH) -X main.commit $(COMMIT)"
4
5default: build
6
7race:
8 @TEST_FREELIST_TYPE=hashmap go test -v -race -test.run="TestSimulate_(100op|1000op)"
9 @echo "array freelist test"
10 @TEST_FREELIST_TYPE=array go test -v -race -test.run="TestSimulate_(100op|1000op)"
11
12fmt:
13 !(gofmt -l -s -d $(shell find . -name \*.go) | grep '[a-z]')
14
15# go get honnef.co/go/tools/simple
16gosimple:
17 gosimple ./...
18
19# go get honnef.co/go/tools/unused
20unused:
21 unused ./...
22
23# go get github.com/kisielk/errcheck
24errcheck:
25 @errcheck -ignorepkg=bytes -ignore=os:Remove go.etcd.io/bbolt
26
27test:
28 TEST_FREELIST_TYPE=hashmap go test -timeout 20m -v -coverprofile cover.out -covermode atomic
29 # Note: gets "program not an importable package" in out of path builds
30 TEST_FREELIST_TYPE=hashmap go test -v ./cmd/bbolt
31
32 @echo "array freelist test"
33
34 @TEST_FREELIST_TYPE=array go test -timeout 20m -v -coverprofile cover.out -covermode atomic
35 # Note: gets "program not an importable package" in out of path builds
36 @TEST_FREELIST_TYPE=array go test -v ./cmd/bbolt
37
38.PHONY: race fmt errcheck test gosimple unused