From e60a614a377e78a06fcadf73b16d8e8c2ed838bc Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 16 Feb 2015 09:58:17 -0800 Subject: [PATCH] Add cover tasks to test code coverage --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 7ea72d97f..fdb9ab3d6 100644 --- a/Makefile +++ b/Makefile @@ -40,6 +40,14 @@ updatedeps: | sort -u \ | xargs go get -f -u -v +cover: + @go tool cover 2>/dev/null; if [ $$? -eq 3 ]; then \ + go get -u golang.org/x/tools/cmd/cover; \ + fi + go test $(TEST) -coverprofile=coverage.out + go tool cover -html=coverage.out + rm coverage.out + # vet runs the Go source code static analysis tool `vet` to find # any common errors. vet: