forked from txaty/go-merkletree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (24 loc) · 951 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
.PHONY: test test_race test_with_mock test_fuzz test_ci_coverage format bench report_bench cpu_report mem_report build
COVER_OUT := coverage.out
COVER_HTML := coverage.html
test: COVER_OPTS = -covermode count
test_race: COVER_OPTS = -race -covermode atomic
test_with_mock: COVER_OPTS = -race -gcflags=all=-l -covermode atomic
test test_race test_with_mock:
go test -v $(COVER_OPTS) -coverprofile=$(COVER_OUT) && go tool cover -html=$(COVER_OUT) -o $(COVER_HTML) && go tool cover -func=$(COVER_OUT) -o $(COVER_OUT)
test_fuzz:
go test -v -race -fuzz=FuzzMerkleTreeNew -fuzztime=60m -run ^FuzzMerkleTreeNew$
test_ci_coverage:
go test -race -gcflags=all=-l -coverprofile=coverage.txt -covermode=atomic
format:
go fmt .
bench:
go test -bench . -benchmem -cpu 1
report_bench:
go test -cpuprofile cpu.prof -memprofile mem.prof -bench . -cpu 1
cpu_report:
go tool pprof cpu.prof
mem_report:
go tool pprof mem.prof
build:
go build -v ./...