Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Commit

Permalink
put test commands into a Makefile (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
SiegfriedEhret authored and rlespinasse committed Oct 31, 2017
1 parent 161495f commit 0dca882
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
6 changes: 4 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@ 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
-----

=== launch the benchmark

[source,shell]
-----
$ go test -bench=. .
$ make bench
goos: ...
goarch: ...
pkg: github.com/rlespinasse/byteslice
Expand Down

0 comments on commit 0dca882

Please sign in to comment.