Skip to content

Commit 5eacb27

Browse files
committed
Added coverage.sh
1 parent 12652a9 commit 5eacb27

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ debug
33
debug.test
44
data/*
55
/vendor
6-
coverage.out
76
coverage.txt

coverage.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
echo "" > coverage.txt
5+
6+
for d in $(go list ./... | grep -v vendor); do
7+
go test -race -coverprofile=profile.out -covermode=atomic $d
8+
if [ -f profile.out ]; then
9+
cat profile.out >> coverage.txt
10+
rm profile.out
11+
fi
12+
done

makefile

+1-4
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,13 @@ test:
3030
go test -v ./...
3131

3232
coverage:
33-
- echo 'mode: atomic' > coverage.txt && go list ./... | xargs -n1 -I{} sh -c 'go test -covermode=atomic -coverprofile=coverage.tmp {} && tail -n +2 coverage.tmp >> coverage.txt'
34-
rm coverage.tmp
33+
./coverage.sh
3534

3635
# https://godoc.org/golang.org/x/tools/cmd/vet
3736
vet:
3837
go vet -v
3938

4039
get-deps:
41-
go get github.com/mattn/goveralls
42-
go get -u github.com/AlekSi/gocoverutil
4340
glide install
4441

4542
release:

0 commit comments

Comments
 (0)