File: cov_report.sh

package info (click to toggle)
golang-github-davecgh-go-spew 1.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch, stretch-backports
  • size: 312 kB
  • sloc: makefile: 11; sh: 11
file content (22 lines) | stat: -rw-r--r-- 658 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

# This script uses gocov to generate a test coverage report.
# The gocov tool my be obtained with the following command:
#   go get github.com/axw/gocov/gocov
#
# It will be installed to $GOPATH/bin, so ensure that location is in your $PATH.

# Check for gocov.
if ! type gocov >/dev/null 2>&1; then
	echo >&2 "This script requires the gocov tool."
	echo >&2 "You may obtain it with the following command:"
	echo >&2 "go get github.com/axw/gocov/gocov"
	exit 1
fi

# Only run the cgo tests if gcc is installed.
if type gcc >/dev/null 2>&1; then
	(cd spew && gocov test -tags testcgo | gocov report)
else
	(cd spew && gocov test | gocov report)
fi