Add new cover bundlescript for giving a nice report across all the coverprofiles generated by the test scripts

Upstream-commit: 59dc2876a7d2ac0e231d7d97511e572a1d739136
Component: engine
This commit is contained in:
Tianon Gravi
2013-12-08 20:20:55 -07:00
parent 433f293713
commit 6a19f653da
3 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,21 @@
#!/bin/bash
DEST="$1"
bundle_cover() {
coverprofiles=( "$DEST/../"*"/coverprofiles/"* )
for p in "${coverprofiles[@]}"; do
echo
(
set -x
go tool cover -func="$p"
)
done
}
if [ "$HAVE_GO_TEST_COVER" ]; then
bundle_cover 2>&1 | tee "$DEST/report.log"
else
echo >&2 'warning: the current version of go does not support -cover'
echo >&2 ' skipping test coverage report'
fi