-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (30 loc) · 1.01 KB
/
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
export TESTSALT = 86A96823-FD69-4556-8960-34887473750A
export CC_TEST_REPORTER_ID = 1991acb633e90e7202a5d1fac9998f78b608f40147363199553cf70ecf5b2564
COVERAGEOUTFILE=c.out
all: test race
.PHONY: dep
dep:
go mod vendor
.PHONY: test-vendor
test-vendor:
go test -mod=vendor -coverprofile=$(COVERAGEOUTFILE) -covermode=count
.PHONY: test
test: dep
go test -coverprofile=$(COVERAGEOUTFILE) -covermode=count
.PHONY: race
race: dep
go test -race
.PHONY: test-report
test-report: test
go tool cover -html=$(COVERAGEOUTFILE)
.PHONY: travis
travis:
go test -coverprofile $(COVERAGEOUTFILE) ./...
.PHONY: cclimate-linux
cclimate-linux:
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
# curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-darwin-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
go test -coverprofile $(COVERAGEOUTFILE) ./...
./cc-test-reporter after-build --exit-code $(TRAVIS_TEST_RESULT)