Browse Source

Coverage tooling!

Signed-off-by: Erik Hollensbe <github@hollensbe.org>
master
Erik Hollensbe 6 years ago
parent
commit
e1e290fdda
  1. 2
      .gitignore
  2. 10
      Makefile

2
.gitignore

@ -0,0 +1,2 @@
cover.out
coverage.html

10
Makefile

@ -1,5 +1,13 @@
test: golint
go test -v ./...
set -e; \
for pkg in $$(go list ./...); \
do \
dir="$$(echo $${GOPATH} | awk -F: '{ print $$1 }')/src/$${pkg}"; \
out="$$dir/cover.out"; \
echo "$$out"; \
go test -v "$$pkg" -coverprofile="$$out"; \
go tool cover -html="$$out" -o "$$dir/coverage.html" 2>/dev/null || :; \
done
reflex:
reflex -r '.*\.go$$' -- make test

Loading…
Cancel
Save