Skip to content

Instantly share code, notes, and snippets.

@mstssk
Created July 24, 2018 08:51
Show Gist options
  • Save mstssk/3c0c74bac0e454bae32c56ca4d882b5e to your computer and use it in GitHub Desktop.
Save mstssk/3c0c74bac0e454bae32c56ca4d882b5e to your computer and use it in GitHub Desktop.
任意のGoのテストのカバレッジを抜くやつ
#!sh -eux
cd `dirname $0`/../server
GOPATH=$GOPATH:`pwd`
cd src/
out1=$(mktemp)
out2=$(mktemp)
html=$(mktemp)
mv $html $html.html
html=$html.html
gb gae test -v -tags=testerator -coverprofile=$out1 testPackage -run TestFoobar
echo "mode: set" > $out2
cat $out1 | grep "target_file_name" >> $out2
go tool cover -html=$out2 -o $html
open $html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment