-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (35 loc) · 961 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
36
37
38
39
40
41
.PHONY: test
test:
go test -run=^Test -race -cover .
.PHONY: bench
bench:
go test -run=^$$ -cover -bench .
.PHONY: fuzz
fuzz:
go test -run=^$$ -race -cover -fuzztime 1h -fuzz "FuzzReaderParser" .
go test -run=^$$ -race -cover -fuzztime 1h -fuzz "FuzzStringParser" .
.PHONY: security
security:
@echo "> Racing testing..."
@go test -race -cover .
@echo -e "\n> Racing benchmarks..."
@go test -run=^$$ -race -cover -bench .
@echo -e "\n> Running gosec..."
@gosec .
.PHONY: clean
clean:
rm -rf testdata
rm -f *.out
go clean
go fmt
go vet
.PHONY: profileEncoder
profileEncoder:
go test -cpuprofile cpu.out -memprofile mem.out -bench "BenchmarkEncoder" .
@echo "CPU Profile"
go tool pprof --http localhost:18888 bencode.test cpu.out
.PHONY: profileStringParser
profileStringParser:
go test -cpuprofile cpu.out -memprofile mem.out -bench "BenchmarkStringParser" .
@echo "CPU Profile"
go tool pprof --http localhost:18888 bencode.test cpu.out