diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a163164 --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +.DEFAULT_GOAL := test + +test: ## Start tests + @go test -coverprofile=/tmp/byteslice-cover . + +bench: ## Start benchmark + @go test -bench=. . + +help: ## Print this message + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' + +.PHONY: bench help test diff --git a/README.adoc b/README.adoc index 54ad705..f0316ea 100644 --- a/README.adoc +++ b/README.adoc @@ -5,11 +5,13 @@ image:https://coveralls.io/repos/github/rlespinasse/byteslice/badge.svg?branch=m == How to +Run `make help` to see the available commands. + === test it with coverage [source,shell] ----- -$ go test -coverprofile=/tmp/byteslice-cover . +$ make test ok github.com/rlespinasse/byteslice 0.007s coverage: 100.0% of statements ----- @@ -17,7 +19,7 @@ ok github.com/rlespinasse/byteslice 0.007s coverage: 100.0% of statements [source,shell] ----- -$ go test -bench=. . +$ make bench goos: ... goarch: ... pkg: github.com/rlespinasse/byteslice