-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
48 lines (38 loc) · 953 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
42
43
44
45
46
47
48
headless-image := chromedp/headless-shell:stable
pkg := .
func := .
deps:
@go get -d -t ./...
@docker pull $(headless-image)
test:
@go test --cover --timeout 5s --race ./...
test.cdp:
@GOOS=linux GOARCH=amd64 go test -c ./antcdp
@mv antcdp.test antcdp
@docker run --rm \
--volume=$(PWD)/antcdp:/antcdp \
--entrypoint=/antcdp/antcdp.test \
--workdir=/antcdp \
--env=HEADLESS_SHELL=/headless-shell/headless-shell \
$(headless-image) \
--test.timeout 10s \
--test.v
bench:
@go test \
--run=Bench \
--bench=$(func) \
--benchmem \
$(pkg)
prof.%:
@go test --run=Bench --bench=$(func) --$*profile=$*.prof
@go tool pprof --http :8080 ant.test $*.prof
trace:
@go test --run=Bench --bench=$(func) --trace ant.trace $(pkg)
@go tool trace ant.trace
cover:
@go test --coverprofile test.cover ./...
@go tool cover --html=test.cover
embed:
@embedmd -w Readme.md
clean:
rm -fr *.test *.prof *.cover *.trace antcdp/*.test