aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2018-02-04 22:05:29 +0100
committerStefan Majewsky <majewsky@gmx.net>2018-02-04 22:05:29 +0100
commit137f2df4bc383058d59cc0b283c41ef11a1eaebd (patch)
tree79ee592b40fbd90a6b51b1d8fea23a272b6dff6b /Makefile
parent439655852e6b136b3a4793c8c3b062c4366e1149 (diff)
downloadgo-schwift-137f2df4bc383058d59cc0b283c41ef11a1eaebd.tar.gz
add Makefile for running tests
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 22 insertions, 0 deletions
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