ipld-eth-server/vendor/github.com/polydawn/refmt/cover
Elizabeth Engelman 36533f7c3f Update vendor directory and make necessary code changes
Fixes for new geth version
2019-09-25 16:32:27 -05:00

23 lines
542 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
PROJECT="github.com/polydawn/refmt"
SUBSECTION=${1:-./...}
export GOPATH="$PWD/.gopath"
CoverPkg() {
pkg="$1"
coverFile="$GOPATH/tmp/$pkg.cover"
mkdir -p "$(dirname "$coverFile")"
rm -f "$coverFile"
go test -coverprofile="$coverFile" "$pkg" \
| tee /dev/stderr | grep "\[no test files\]$" > /dev/null || \
go tool cover -html="$coverFile"
}
for pkg in $(go list "$SUBSECTION" | sed "s#^_${PWD}#${PROJECT}#"); do
CoverPkg "$pkg" || true # continue even if errors from packages that lack tests.
done