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

🔧 add makefile #58

Merged
merged 2 commits into from
Oct 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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