3 # This script uses gocov to generate a test coverage report.
4 # The gocov tool my be obtained with the following command:
5 # go get github.com/axw/gocov/gocov
7 # It will be installed to $GOPATH/bin, so ensure that location is in your $PATH.
10 if ! type gocov >/dev/null 2>&1; then
11 echo >&2 "This script requires the gocov tool."
12 echo >&2 "You may obtain it with the following command:"
13 echo >&2 "go get github.com/axw/gocov/gocov"
17 # Only run the cgo tests if gcc is installed.
18 if type gcc >/dev/null 2>&1; then
19 (cd spew && gocov test -tags testcgo | gocov report)
21 (cd spew && gocov test | gocov report)