mirror of https://github.com/dexidp/dex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
476 B
28 lines
476 B
|
11 years ago
|
#!/bin/bash -e
|
||
|
|
#
|
||
|
|
# Generate coverage HTML for a package
|
||
|
|
# e.g. PKG=./unit ./cover
|
||
|
|
#
|
||
|
|
|
||
|
|
if [ -z "$PKG" ]; then
|
||
|
|
echo "cover only works with a single package, sorry"
|
||
|
|
exit 255
|
||
|
|
fi
|
||
|
|
|
||
|
|
COVEROUT="coverage"
|
||
|
|
|
||
|
|
if ! [ -d "$COVEROUT" ]; then
|
||
|
|
mkdir "$COVEROUT"
|
||
|
|
fi
|
||
|
|
|
||
|
|
# strip out slashes and dots
|
||
|
|
COVERPKG=${PKG//\//}
|
||
|
|
COVERPKG=${COVERPKG//./}
|
||
|
|
|
||
|
|
# generate arg for "go test"
|
||
|
|
export COVER="-coverprofile ${COVEROUT}/${COVERPKG}.out"
|
||
|
|
|
||
|
|
source ./test
|
||
|
|
|
||
|
|
go tool cover -html=${COVEROUT}/${COVERPKG}.out
|