-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
35 lines (29 loc) · 963 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
SHELL = /bin/bash
.ONESHELL:
.PHONY: test
test:
go test -timeout=3m -race . -coverprofile=coverage.out -covermode=atomic
send-cover:
go install github.com/mattn/[email protected]
goveralls -coverprofile=coverage.out -service=github
.PHONY: lint
lint:
go install github.com/golangci/golangci-lint/cmd/[email protected]
~/go/bin/golangci-lint run
.PHONY: doctoc
doctoc:
doctoc --title "**Table of Contents**" --github README.md
.PHONY: gen-bench
gen-bench:
pushd bench
libs=(go-redis redigo redjet rueidis);
for lib in $${libs[@]}; do
echo "Benchmarking $$lib";
go test -bench=. -count=10 -run=. -lib=$$lib \
-memprofile=/tmp/$$lib.mem.out -cpuprofile=/tmp/$$lib.cpu.out | tee /tmp/$$lib.bench.out
echo "Finished benchmarking $$lib";
done
benchstat -table .fullname -row=unit -col .file \
redjet=/tmp/redjet.bench.out redigo=/tmp/redigo.bench.out \
go-redis=/tmp/go-redis.bench.out rueidis=/tmp/rueidis.bench.out \
> benchstat.txt