diff options
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | Makefile | 22 |
2 files changed, 25 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..60fe31d --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# test artifacts +cover.out +cover.html diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..05fcf20 --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +all: + @echo 'Available targets:' + @echo ' make test' + +test: static-tests cover.html + +static-tests: FORCE + @echo '>> gofmt...' + @if s="$$(gofmt -s -l $$(find -name \*.go) 2>/dev/null)" && test -n "$$s"; then echo "$$s"; false; fi + @echo '>> golint...' + @if s="$$(golint ./... 2>/dev/null)" && test -n "$$s"; then echo "$$s"; false; fi + @echo '>> govet...' + @go vet ./... + +cover.out: FORCE + @echo '>> go test...' + @go test -cover -coverprofile $@ +cover.html: cover.out + @echo '>> rendering cover.html...' + @go tool cover -html=$< -o $@ + +.PHONY: FORCE |
