bolt/Makefile

55 lines
1.2 KiB
Makefile
Raw Normal View History

2014-01-12 05:51:01 +00:00
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)"
2014-01-12 05:51:01 +00:00
default: build
2014-04-11 13:55:14 +00:00
bench:
2014-04-14 15:45:44 +00:00
go test -v -test.run=NOTHINCONTAINSTHIS -test.bench=$(BENCH)
2014-01-12 05:51:01 +00:00
2014-02-20 16:11:52 +00:00
# http://cloc.sourceforge.net/
cloc:
@cloc --not-match-f='Makefile|_test.go' .
2014-01-12 05:51:01 +00:00
cover: fmt
go test -coverprofile=$(COVERPROFILE) -test.run=$(TEST) $(COVERFLAG) .
2014-01-12 05:51:01 +00:00
go tool cover -html=$(COVERPROFILE)
rm $(COVERPROFILE)
2014-03-04 20:02:17 +00:00
cpuprofile: fmt
@go test -c
@./bolt.test -test.v -test.run=$(TEST) -test.cpuprofile cpu.prof
2014-03-04 20:02:17 +00:00
2014-03-24 13:38:27 +00:00
# go get github.com/kisielk/errcheck
errcheck:
@echo "=== errcheck ==="
@errcheck github.com/boltdb/bolt
2014-03-24 13:38:27 +00:00
2014-01-12 05:51:01 +00:00
fmt:
@go fmt ./...
2014-04-08 12:34:26 +00:00
get:
@go get -d ./...
build: get
@mkdir -p bin
@go build -ldflags=$(GOLDFLAGS) -a -o bin/bolt ./cmd/bolt
2014-04-08 12:34:26 +00:00
2014-03-24 13:38:27 +00:00
test: fmt errcheck
2014-04-08 12:34:26 +00:00
@go get github.com/stretchr/testify/assert
@echo "=== TESTS ==="
2014-02-09 22:52:19 +00:00
@go test -v -cover -test.run=$(TEST)
@echo ""
@echo ""
@echo "=== CLI ==="
@go test -v -test.run=$(TEST) ./cmd/bolt
@echo ""
@echo ""
@echo "=== RACE DETECTOR ==="
2014-04-11 21:15:56 +00:00
@go test -v -race -test.run="TestSimulate_(100op|1000op)"
2014-01-12 05:51:01 +00:00
2014-03-04 20:02:17 +00:00
.PHONY: bench cloc cover cpuprofile fmt memprofile test