-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
47 lines (38 loc) · 1.02 KB
/
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
.PHONY: run
run:
cd sample; go run . vnc 10.0.0.11 5901
.PHONY: rdp
rdp:
cd sample; go run . rdp `ipconfig getifaddr en0` 3389
.PHONY: qemu
qemu:
cd sample; go run . vnc `ipconfig getifaddr en0` 5900
.PHONY: watch
watch:
ginkgo watch -notify ./...
.PHONY: test
test:
ginkgo -coverprofile=reports/coverage.out ./... -v
.PHONY: bench
bench:
go test -bench=. -run=XXX ./...
.PHONY: coverage
coverage:
mkdir -p reports
go test -coverprofile=reports/coverage.out -v -coverpkg ./... ./...
go tool cover -func=reports/coverage.out
go tool cover -html=reports/coverage.out -o reports/index.html
open reports/index.html
.PHONY: test
doc:
@echo "Doc server address: http://localhost:6060/pkg"
godoc -http=:6060
.PHONY: release
release:
@if [[ ! "${V}" =~ ^[0-9]+\.[0-9]+\.[0-9]+.*$$ ]]; then echo "Usage: make release V=X.X.X"; exit 1; fi
go mod tidy
make test
@if [ -n "`git status -s`" ]; then echo "\n\nThere are pending changes. Please commit first"; exit 1; fi
git tag v${V}
git push origin v${V}
git push origin master