aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/opentracing/opentracing-go/Makefile
blob: d49a5c0d44fb95a4d8a13026a5f9de8971bb45a2 (plain) (blame)
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
PACKAGES := . ./mocktracer/... ./ext/...

.DEFAULT_GOAL := test-and-lint

.PHONE: test-and-lint

test-and-lint: test lint

.PHONY: test
test:
    go test -v -cover -race ./...

cover:
    @rm -rf cover-all.out
    $(foreach pkg, $(PACKAGES), $(MAKE) cover-pkg PKG=$(pkg) || true;)
    @grep mode: cover.out > coverage.out
    @cat cover-all.out >> coverage.out
    go tool cover -html=coverage.out -o cover.html
    @rm -rf cover.out cover-all.out coverage.out

cover-pkg:
    go test -coverprofile cover.out $(PKG)
    @grep -v mode: cover.out >> cover-all.out

.PHONY: lint
lint:
    go fmt ./...
    golint ./...
    @# Run again with magic to exit non-zero if golint outputs anything.
    @! (golint ./... | read dummy)
    go vet ./...