File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -17,4 +17,8 @@ install:
17
17
18
18
script :
19
19
- cd $GOPATH/src/srcd.works/go-billy.v1
20
- - go test -v ./...
20
+ - go test -v ./...
21
+ - make test-coverage
22
+
23
+ after_success :
24
+ - bash <(curl -s https://codecov.io/bash)
Original file line number Diff line number Diff line change
1
+ # General
2
+ WORKDIR = $(PWD )
3
+
4
+ # Go parameters
5
+ GOCMD = go
6
+ GOTEST = $(GOCMD ) test -v
7
+
8
+ # Coverage
9
+ COVERAGE_REPORT = coverage.txt
10
+ COVERAGE_PROFILE = profile.out
11
+ COVERAGE_MODE = atomic
12
+
13
+ test-coverage :
14
+ cd $(WORKDIR ) ; \
15
+ echo " " > $(COVERAGE_REPORT ) ; \
16
+ for dir in ` find . -name " *.go" | grep -o ' .*/' | sort | uniq` ; do \
17
+ $(GOTEST ) $$ dir -coverprofile=$(COVERAGE_PROFILE ) -covermode=$(COVERAGE_MODE ) ; \
18
+ if [ $$ ? != 0 ]; then \
19
+ exit 2; \
20
+ fi ; \
21
+ if [ -f $( COVERAGE_PROFILE) ]; then \
22
+ cat $(COVERAGE_PROFILE ) >> $(COVERAGE_REPORT ) ; \
23
+ rm $(COVERAGE_PROFILE ) ; \
24
+ fi ; \
25
+ done ; \
You can’t perform that action at this time.
0 commit comments