Skip to content
This repository has been archived by the owner on Jul 28, 2020. It is now read-only.

Commit

Permalink
Update coverage tests for Go <1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
zhevron committed Dec 12, 2014
1 parent 3970941 commit 1fb7e30
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
echo "mode: set" > acc.out
fail=0

# Install the old cover tool if version is not 1.4 or higher.
if [ -n "$TRAVIS_GO_VERSION" ] && [[ "$TRAVIS_GO_VERSION" < "go1.4" ]]; then
go get code.google.com/p/go.tools/cmd/cover
fi

# Standard go tooling behavior is to ignore dirs with leading underscors
for dir in $(find . -maxdepth 10 -not -path './.git*' -not -path '*/_*' -type d); do
for dir in $(find . -maxdepth 10 -not -path './cmd/*' -not -path './.git*' -not -path '*/_*' -type d); do
if ls $dir/*.go &> /dev/null; then
go test -v -coverprofile=profile.out $dir -check.v || fail=1
if [ -f profile.out ]; then
Expand All @@ -17,7 +22,6 @@ done

# Failures have incomplete results, so don't send
if [ -n "$COVERALLS_TOKEN" ] && [ "$fail" -eq 0 ]; then
echo "SENDING"
$HOME/gopath/bin/goveralls -v -coverprofile=acc.out -service travis-ci -repotoken $COVERALLS_TOKEN
fi

Expand Down

0 comments on commit 1fb7e30

Please sign in to comment.