forked from uber-go/zap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (34 loc) · 981 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
export GO15VENDOREXPERIMENT=1
BENCH_FLAGS ?= -cpuprofile=cpu.pprof -memprofile=mem.pprof -benchmem
PACKAGES ?= $(shell glide novendor)
.PHONY: all
all: lint test
.PHONY: dependencies
dependencies:
glide --version || go get -u -f github.com/Masterminds/glide
glide install
go install ./vendor/github.com/golang/lint/golint
go install ./vendor/github.com/axw/gocov/gocov
go install ./vendor/github.com/mattn/goveralls
.PHONY: lint
lint:
rm -rf lint.log
@echo "Checking formatting..."
gofmt -d -s *.go benchmarks 2>&1 | tee lint.log
@echo "Checking vet..."
go tool vet *.go 2>&1 | tee -a lint.log
go tool vet benchmarks 2>&1 | tee -a lint.log
@echo "Checking lint..."
golint . 2>&1 | tee -a lint.log
golint benchmarks 2>&1 | tee -a lint.log
@[ ! -s lint.log ]
.PHONY: test
test:
go test -race $(PACKAGES)
.PHONY: coveralls
coveralls:
goveralls -service=travis-ci $(PACKAGES)
.PHONY: bench
BENCH ?= .
bench:
go test -bench=$(BENCH) $(BENCH_FLAGS) ./benchmarks