https://github.com/etcd-io/etcd
Revision 621b43bacb9f206db1eaacf4ec6a929cfe3937f4 authored by Xiang Li on 29 June 2015, 23:59:08 UTC, committed by Xiang Li on 29 June 2015, 23:59:08 UTC
update gogoprotobuf dependency
2 parent s 235aef5 + 13f44e4
Raw File
Tip revision: 621b43bacb9f206db1eaacf4ec6a929cfe3937f4 authored by Xiang Li on 29 June 2015, 23:59:08 UTC
Merge pull request #3078 from xiang90/gogo
Tip revision: 621b43b
cover
#!/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 leading dot/slash and trailing slash and sanitize other slashes
# e.g. ./etcdserver/etcdhttp/ ==> etcdserver_etcdhttp
COVERPKG=${PKG/#./}
COVERPKG=${COVERPKG/#\//}
COVERPKG=${COVERPKG/%\//}
COVERPKG=${COVERPKG//\//_}

# generate arg for "go test"
export COVER="-coverprofile ${COVEROUT}/${COVERPKG}.out"

source ./test

go tool cover -html=${COVEROUT}/${COVERPKG}.out
back to top