Skip to content

Commit 8c9aa27

Browse files
committed
add coverage command.
Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent a84bfdb commit 8c9aa27

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ _testmain.go
2424
*.prof
2525
.DS_Store
2626
gin-bin
27-
coverage.out
27+
coverage.txt

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ install:
1919
- go get github.com/mattn/goveralls
2020

2121
script:
22-
- go test -v -covermode=count -coverprofile=coverage.txt
22+
- make test
2323
- $(go env GOPATH | awk 'BEGIN{FS=":"} {print $1}')/bin/goveralls -coverprofile=coverage.txt -service=travis-ci -repotoken=$COVERALLS_TOKEN
2424

2525
after_success:

Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
.PHONY: test
22

33
test:
4-
go test -v
4+
go test -v -covermode=count -coverprofile=coverage.txt
5+
6+
html:
7+
go tool cover -html=coverage.txt

0 commit comments

Comments
 (0)