Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit d3a39f2

Browse files
committed
Merge branch 'master' of github.com:src-d/go-git
2 parents d015556 + 1cad23e commit d3a39f2

File tree

2 files changed

+38
-12
lines changed

2 files changed

+38
-12
lines changed

.travis.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ language: go
33
go:
44
- 1.4
55
- 1.5
6+
- tip
67

78
install:
89
- rm -rf $GOPATH/src/gopkg.in/src-d
@@ -11,18 +12,7 @@ install:
1112
- go get -v -t ./...
1213

1314
script:
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

2717
after_success:
2818
- bash <(curl -s https://codecov.io/bash)

Makefile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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; \

0 commit comments

Comments
 (0)