This repository was archived by the owner on Sep 11, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +38
-12
lines changed Expand file tree Collapse file tree 2 files changed +38
-12
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ language: go
33go :
44 - 1.4
55 - 1.5
6+ - tip
67
78install :
89 - rm -rf $GOPATH/src/gopkg.in/src-d
@@ -11,18 +12,7 @@ install:
1112 - go get -v -t ./...
1213
1314script :
14- - go test -v ./...
15-
16- script :
17- - go test -v gopkg.in/src-d/go-git.v2 -covermode=count -coverprofile=coverage.out
18- - go test -v gopkg.in/src-d/go-git.v2/clients/common -covermode=count -coverprofile=tmp.out
19- - tail -n +2 tmp.out >> coverage.out
20- - go test -v gopkg.in/src-d/go-git.v2/clients/http -covermode=count -coverprofile=tmp.out
21- - tail -n +2 tmp.out >> coverage.out
22- - go test -v gopkg.in/src-d/go-git.v2/formats/packfile -covermode=count -coverprofile=tmp.out
23- - tail -n +2 tmp.out >> coverage.out
24- - go test -v gopkg.in/src-d/go-git.v2/formats/pktline -covermode=count -coverprofile=tmp.out
25- - tail -n +2 tmp.out >> coverage.out
15+ - make test-coverage
2616
2717after_success :
2818 - bash <(curl -s https://codecov.io/bash)
Original file line number Diff line number Diff line change 1+ # Default shell
2+ SHELL := /bin/bash
3+
4+ # General
5+ WORKDIR = $(PWD )
6+
7+ # Go parameters
8+ GOCMD = go
9+ GOTEST = $(GOCMD ) test -v
10+
11+ # Coverage
12+ COVERAGE_REPORT = coverage.txt
13+ COVERAGE_PROFILE = profile.out
14+ COVERAGE_MODE = atomic
15+
16+ ifneq ($(origin CI ) , undefined)
17+ WORKDIR := $(TRAVIS_BUILD_DIR)
18+ endif
19+
20+
21+ test :
22+ $(GOTEST ) ./...
23+
24+ test-coverage :
25+ cd $(WORKDIR ) ; \
26+ echo " " > $(COVERAGE_REPORT ) ; \
27+ for dir in ` find . -name " *.go" | grep -o ' .*/' | sort | uniq` ; do \
28+ $(GOTEST ) $$ dir -coverprofile=$(COVERAGE_PROFILE ) -covermode=$(COVERAGE_MODE ) ; \
29+ if [ $$ ? != 0 ]; then \
30+ exit 2; \
31+ fi ; \
32+ if [ -f $( COVERAGE_PROFILE) ]; then \
33+ cat $(COVERAGE_PROFILE ) >> $(COVERAGE_REPORT ) ; \
34+ rm $(COVERAGE_PROFILE ) ; \
35+ fi ; \
36+ done ; \
You can’t perform that action at this time.
0 commit comments