hack/test: generate code coverage report
@@ -49,8 +49,16 @@ function e2e_pass {
}
function unittest_pass {
+ echo "mode: atomic" > coverage.txt
TEST_PKGS=`go list ./pkg/...`
- go test ${TEST_PKGS} --race
+ for pkg in $TEST_PKGS
+ do
+ go test -race -covermode=atomic -coverprofile=profile.out $pkg
+ if [ -f profile.out ]; then
+ tail -n +2 profile.out >> coverage.txt
+ rm profile.out
+ fi
+ done
}
for p in $PASSES; do
