forked from etcd-io/bbolt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
2c56b2a
commit 8b08bd4
Showing
14 changed files
with
3,337 additions
and
2,057 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.