Files
weave-scope/bin/test
2015-05-22 15:02:36 +00:00

18 lines
457 B
Bash
Executable File

#!/bin/sh
echo "mode: count" > profile.cov
fail=0
for dir in $(find . -type f -name '*_test.go' | grep -v '^./experimental/' | xargs -n1 dirname | sort -u); do
go get -t $dir
output=$(mktemp cover.XXXXXXXXXX)
if ! go test -tags netgo -covermode=count -coverprofile=$output $dir ; then
fail=1
fi
if [ -f $output ]; then
tail -n +2 <$output >>profile.cov
rm $output
fi
done
go tool cover -html=profile.cov -o=coverage.html
exit $fail