https://github.com/etcd-io/etcd
Revision d412eaa3a206899a0dc8c79099c82a56f03ec6c6 authored by Yicheng Qin on 01 September 2015, 21:04:38 UTC, committed by Yicheng Qin on 01 September 2015, 21:04:38 UTC
Use ugorji codec for unmarshalling key responses in client
2 parent s 53b8175 + 7083828
Raw File
Tip revision: d412eaa3a206899a0dc8c79099c82a56f03ec6c6 authored by Yicheng Qin on 01 September 2015, 21:04:38 UTC
Merge pull request #3308 from yichengq/go-codec
Tip revision: d412eaa
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