-
Notifications
You must be signed in to change notification settings - Fork 10
/
makefile
22 lines (18 loc) · 688 Bytes
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
COVERAGE_OUT_DIRECTORY="coverage/lcov"
.PHONY: check
check:
go test -cover ./...
.PHONY: cover
cover:
go test -coverpkg=./... -coverprofile coverage.out.tmp ./...
(cat coverage.out.tmp | grep -v "mocks/" > coverage.out) && rm coverage.out.tmp
go tool cover -func=coverage.out > coverage/coverage.txt
.PHONY: cover
cover-lcov:
go get -u github.com/jandelgado/gcov2lcov
go test -coverpkg=./... -coverprofile coverage.out.tmp ./...
(cat coverage.out.tmp | grep -v "mocks/" > coverage.out) && rm coverage.out.tmp
cat coverage.out | gcov2lcov -outfile=coverage.lcov
genhtml coverage.lcov -o $(COVERAGE_OUT_DIRECTORY) && open $(COVERAGE_OUT_DIRECTORY)/index.html
fmt:
go fmt ./...