Skip to content

Instantly share code, notes, and snippets.

@subosito
Created July 29, 2016 03:29
Show Gist options
  • Save subosito/bc68355decc59b2eb03dbde9e12ef864 to your computer and use it in GitHub Desktop.
Save subosito/bc68355decc59b2eb03dbde9e12ef864 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "mode: count" > coverage.out
PACKAGES=`govendor list -no-status +local`
EXIT_CODE=0
for PKG in $PACKAGES; do
echo =-= $PKG
govendor test -v -coverprofile=profile.out -covermode=count $PKG; __EXIT_CODE__=$?
if [ "$__EXIT_CODE__" -ne "0" ]; then
EXIT_CODE=$__EXIT_CODE__
fi
if [ -f profile.out ]; then
tail -n +2 profile.out >> coverage.out; rm profile.out
fi
done
exit $EXIT_CODE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment