From 008316d030117d2cce10e7a22b8e28c15a9725f2 Mon Sep 17 00:00:00 2001 From: Chris Lane Date: Fri, 31 Jan 2020 14:01:57 -0500 Subject: [PATCH] chore: creates `make coverage` target Creates a `make coverage` target that generates a unit-testing coverage report. --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile b/Makefile index ee8dbbb..98bc242 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,7 @@ ZIP := zip -m # build flags BUILD_FLAGS := -ldflags="-s -w" -mod vendor -trimpath GOBIN := +TMPDIR := /tmp # release binaries releases := \ @@ -137,6 +138,12 @@ vet: test: $(GO) test ./... +## coverage: generates a test coverage report +.PHONY: coverage +coverage: + $(GO) test ./... -coverprofile=$(TMPDIR)/cheat-coverage.out && \ + $(GO) tool cover -html=$(TMPDIR)/cheat-coverage.out + ## check: formats, lints, vets, vendors, and run unit-tests .PHONY: check check: | vendor fmt lint vet test