-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
4 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,26 @@ | ||
#!/bin/sh | ||
go test -race -v ./... | ||
|
||
# Get Test dependencies | ||
go get github.com/axw/gocov/gocov | ||
go get github.com/mattn/goveralls | ||
go get golang.org/x/tools/cmd/cover | ||
# go get code.google.com/p/go.tools/cmd/cover | ||
go get github.com/modocache/gover | ||
|
||
# Run test coverage on each subdirectories and merge the coverage profile. | ||
|
||
echo "mode: count" > profile.cov | ||
|
||
# Standard go tooling behavior is to ignore dirs with leading underscors | ||
for dir in $(find . -maxdepth 3 -not -path './.git*' -not -path '*/_*' -not -path '_*' -type d -not -path './examples*' -not -path './vendor*' -not -path './output*' -not -path './dist*' -not -path './build*' -not -path './bin*' -not -path './scripts*' -not -path './pact-*'); do | ||
for dir in $(find . -maxdepth 10 -not -path './.git*' -not -path '*/_*' -type d); do | ||
if ls $dir/*.go &> /dev/null; then | ||
go test -covermode=count -coverprofile=$dir/profile.tmp $dir | ||
if [ $? = 1 ]; then | ||
echo "Test failure, exiting" | ||
exit 1 | ||
fi | ||
|
||
if [ -f $dir/profile.tmp ]; then | ||
cat $dir/profile.tmp | tail -n +2 >> profile.cov | ||
rm $dir/profile.tmp | ||
fi | ||
fi | ||
done | ||
|
||
go tool cover -func profile.cov | ||
go tool cover -func profile.cov |