makefile: Add test-cover-html

This commit is contained in:
Bjørn Erik Pedersen 2016-11-27 23:21:10 +01:00
parent 20d82a7a1b
commit b7e800454f
2 changed files with 9 additions and 1 deletions

1
.gitignore vendored
View file

@ -12,3 +12,4 @@ cover.out
*~
vendor/*/
*.bench
coverage*.out

View file

@ -7,6 +7,7 @@
COMMIT_HASH=`git rev-parse --short HEAD 2>/dev/null`
BUILD_DATE=`date +%FT%T%z`
LDFLAGS=-ldflags "-X github.com/spf13/hugo/hugolib.CommitHash=${COMMIT_HASH} -X github.com/spf13/hugo/hugolib.BuildDate=${BUILD_DATE}"
PACKAGES = $(shell govendor list -no-status +local | sed 's/github.com.spf13.hugo/./')
all: gitinfo
@ -74,3 +75,9 @@ vet:
echo "^ go vet errors!" && echo && exit 1; \
fi
test-cover-html:
echo "mode: count" > coverage-all.out
$(foreach pkg,$(PACKAGES),\
govendor test -coverprofile=coverage.out -covermode=count $(pkg);\
tail -n +2 coverage.out >> coverage-all.out;)
go tool cover -html=coverage-all.out