chore: creates `make coverage` target

Creates a `make coverage` target that generates a unit-testing coverage
report.
This commit is contained in:
Chris Lane 2020-01-31 14:01:57 -05:00
parent a59c019642
commit 008316d030
1 changed files with 7 additions and 0 deletions

View File

@ -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