Add Makefile target to run coverage

For now the target fails because there are no tests for the "cmd" package.
Since this is being used manually for now, this is acceptable.
This commit is contained in:
Torin Sandall
2016-04-13 17:59:12 -07:00
parent 6b94279151
commit cf1caf8b92
2 changed files with 10 additions and 1 deletions
+1
View File
@@ -1,3 +1,4 @@
.vscode
opa
opalog/parser.go
coverage
+9 -1
View File
@@ -18,7 +18,7 @@ GO := go
GO15VENDOREXPERIMENT := 1
export GO15VENDOREXPERIMENT
.PHONY: all deps generate build test check check-fmt check-vet check-lint fmt clean
.PHONY: all deps generate build test cover check check-fmt check-vet check-lint fmt clean
all: build test check
@@ -36,6 +36,14 @@ build: generate
test: generate
$(GO) test -v $(PACKAGES)
COVER_PACKAGES=$(PACKAGES)
$(COVER_PACKAGES):
@mkdir -p coverage/$(shell dirname $@)
go test -covermode=count -coverprofile=coverage/$(shell dirname $@)/coverage.out $@
go tool cover -html=coverage/$(shell dirname $@)/coverage.out
cover: $(COVER_PACKAGES)
check: check-fmt check-vet check-lint
check-fmt: