aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2015-12-27 15:27:39 -0700
committerBen Johnson <benbjohnson@yahoo.com>2016-01-02 21:30:31 -0700
commit8b08bd4a8065cb7a240761c3683e8f837b06cc3c (patch)
tree26a01c0d5a3da53f45c7f54062c3af11479c4a2f /Makefile
parentMerge pull request #474 from elithrar/patch-1 (diff)
downloaddedo-8b08bd4a8065cb7a240761c3683e8f837b06cc3c.tar.gz
dedo-8b08bd4a8065cb7a240761c3683e8f837b06cc3c.tar.xz
test suite refactoring
This commit refactors the test suite to make it cleaner and to use the standard testing library better. The `assert()`, `equals()`, and `ok()` functions have been removed and some test names have been changed for clarity. No functionality has been changed.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile50
1 files changed, 7 insertions, 43 deletions
diff --git a/Makefile b/Makefile
index cfbed51..e035e63 100644
--- a/Makefile
+++ b/Makefile
@@ -1,54 +1,18 @@
-TEST=.
-BENCH=.
-COVERPROFILE=/tmp/c.out
BRANCH=`git rev-parse --abbrev-ref HEAD`
COMMIT=`git rev-parse --short HEAD`
GOLDFLAGS="-X main.branch $(BRANCH) -X main.commit $(COMMIT)"
default: build
-bench:
- go test -v -test.run=NOTHINCONTAINSTHIS -test.bench=$(BENCH)
-
-# http://cloc.sourceforge.net/
-cloc:
- @cloc --not-match-f='Makefile|_test.go' .
-
-cover: fmt
- go test -coverprofile=$(COVERPROFILE) -test.run=$(TEST) $(COVERFLAG) .
- go tool cover -html=$(COVERPROFILE)
- rm $(COVERPROFILE)
-
-cpuprofile: fmt
- @go test -c
- @./bolt.test -test.v -test.run=$(TEST) -test.cpuprofile cpu.prof
+race:
+ @go test -v -race -test.run="TestSimulate_(100op|1000op)"
# go get github.com/kisielk/errcheck
errcheck:
- @echo "=== errcheck ==="
- @errcheck github.com/boltdb/bolt
+ @errcheck -ignorepkg=bytes -ignore=os:Remove github.com/boltdb/bolt
-fmt:
- @go fmt ./...
-
-get:
- @go get -d ./...
-
-build: get
- @mkdir -p bin
- @go build -ldflags=$(GOLDFLAGS) -a -o bin/bolt ./cmd/bolt
-
-test: fmt
- @go get github.com/stretchr/testify/assert
- @echo "=== TESTS ==="
- @go test -v -cover -test.run=$(TEST)
- @echo ""
- @echo ""
- @echo "=== CLI ==="
- @go test -v -test.run=$(TEST) ./cmd/bolt
- @echo ""
- @echo ""
- @echo "=== RACE DETECTOR ==="
- @go test -v -race -test.run="TestSimulate_(100op|1000op)"
+test:
+ @go test -v -cover .
+ @go test -v ./cmd/bolt
-.PHONY: bench cloc cover cpuprofile fmt memprofile test
+.PHONY: fmt test