-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
37 lines (28 loc) · 1015 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
.PHONY: all
all: test race bench
test: fmt lint vet
go test $(GO_EXTRAFLAGS) -v -cover -covermode=count ./...
lint:
golint $(GO_EXTRAFLAGS) -set_exit_status
fmt:
@if [ -n "`gofmt -l .`" ]; then \
printf >&2 'Some files are not in the gofmt format. Please fix.'; \
exit 1; \
fi
vet:
# Verbose mode disable to get rid of the error:
# vet: mcrypt.go:9:8: could not import C (can't find import: )
go tool vet *.go
race:
go test $(GO_EXTRAFLAGS) -v -race ./...
bench:
go test $(GO_EXTRAFLAGS) -v -bench=. -benchmem -cpuprofile=cpu.prof -memprofile=mem.prof ./...
go tool pprof -top -lines -nodecount=25 nscatools.test cpu.prof
go tool pprof -text -lines -nodecount=25 -alloc_space nscatools.test mem.prof
go tool pprof -text -lines -nodecount=25 -alloc_objects nscatools.test mem.prof
gocov:
gocov test | gocov report
# gocov test >/tmp/gocovtest.json ; gocov annotate /tmp/gocovtest.json
install: test
go clean -v github.com/tubemogul/nscatools
go install github.com/tubemogul/nscatools