forked from cerc-io/ipld-eth-server
36533f7c3f
Fixes for new geth version
23 lines
542 B
Bash
Executable File
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
|