https://github.com/coreos/etcd
Revision 7b871aab4136b823cd2296276a5c07d70f8c5e8d authored by Yicheng Qin on 21 August 2015, 18:58:37 UTC, committed by Yicheng Qin on 21 August 2015, 18:58:37 UTC
They are only used in this package, so there is no need to public them.
1 parent b1192e5
Raw File
Tip revision: 7b871aab4136b823cd2296276a5c07d70f8c5e8d authored by Yicheng Qin on 21 August 2015, 18:58:37 UTC
pkg/netutil: not export resolve and urlsEqual functions
Tip revision: 7b871aa
cover
#!/usr/bin/env bash
#
# Generate coverage HTML for a package
# e.g. PKG=./unit ./cover
#
set -e

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