aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorFelix Hanley <felix@userspace.com.au>2018-11-20 13:24:55 +0000
committerFelix Hanley <felix@userspace.com.au>2018-11-20 13:24:55 +0000
commit49860f0960cb4f61567b308501c355c6e1cbd2a2 (patch)
treea17bebe05ff6488c1b3994274b3ea34cce5e7c17 /Makefile
parentb36cae1e6b724ad75c98a6b69a6235686d910633 (diff)
downloadlexer-49860f0960cb4f61567b308501c355c6e1cbd2a2.tar.gz
lexer-49860f0960cb4f61567b308501c355c6e1cbd2a2.tar.bz2
Add extra tests and line counting
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 18 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..4667b56
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,18 @@
+
+pkgs := $(shell go list ./...)
+
+.PHONY: lint test clean
+
+ifdef GOPATH
+GO111MODULE=on
+endif
+
+test: lint ## Run tests with coverage
+ go test -short -cover -coverprofile coverage.out $(pkgs)
+ go tool cover -html=coverage.out -o coverage.html
+
+lint:
+ golint $(pkgs)
+
+clean: ## Clean all test files
+ rm -rf coverage*