From b7e800454f985b5f23753452d2f51056f1327239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sun, 27 Nov 2016 23:21:10 +0100 Subject: [PATCH] makefile: Add test-cover-html --- .gitignore | 3 ++- Makefile | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5b726dc04..f72d3ad7a 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ cover.out .DS_Store *~ vendor/*/ -*.bench \ No newline at end of file +*.bench +coverage*.out \ No newline at end of file diff --git a/Makefile b/Makefile index 684e1d1be..6d5aeed18 100644 --- a/Makefile +++ b/Makefile @@ -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 \ No newline at end of file