| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
.PHONY: all todo clean cover mem |
| 6 |
|
| 7 |
testbin=b.test |
| 8 |
|
| 9 |
all: editor |
| 10 |
go build |
| 11 |
go vet |
| 12 |
make todo |
| 13 |
|
| 14 |
editor: |
| 15 |
go fmt |
| 16 |
go test -i |
| 17 |
go test |
| 18 |
|
| 19 |
mem: |
| 20 |
go test -c |
| 21 |
./$(testbin) -test.bench . -test.memprofile mem.out -test.memprofilerate 1 |
| 22 |
go tool pprof --lines --web --alloc_space $(testbin) mem.out |
| 23 |
|
| 24 |
todo: |
| 25 |
@grep -n ^[[:space:]]*_[[:space:]]*=[[:space:]][[:alpha:]][[:alnum:]]* *.go || true |
| 26 |
@grep -n TODO *.go || true |
| 27 |
@grep -n BUG *.go || true |
| 28 |
@grep -n println *.go || true |
| 29 |
|
| 30 |
clean: |
| 31 |
@go clean |
| 32 |
rm -f *~ |
| 33 |
|
| 34 |
cover: |
| 35 |
t=$(shell tempfile) ; go test -coverprofile $$t && go tool cover -html $$t && unlink $$t |