-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
54 lines (42 loc) · 1.41 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
48
49
50
51
52
53
54
GOPATH := $(shell cd ../../..; pwd)
export GOPATH
PROJECT = launchpad.net/ubuntu-push
ifneq ($(CURDIR),$(GOPATH)/src/launchpad.net/ubuntu-push)
$(error unexpected curdir and/or layout)
endif
GODEPS = launchpad.net/gocheck
GODEPS += launchpad.net/go-dbus/v1
bootstrap:
mkdir -p $(GOPATH)/bin
mkdir -p $(GOPATH)/pkg
go get -u launchpad.net/godeps
go get -d -u $(GODEPS)
$(GOPATH)/bin/godeps -u dependencies.tsv
go install $(GODEPS)
check:
go test $(TESTFLAGS) $(PROJECT)/...
check-race:
go test $(TESTFLAGS) -race $(PROJECT)/...
coverage-summary:
go test $(TESTFLAGS) -a -cover $(PROJECT)/...
coverage-html:
mkdir -p coverhtml
for pkg in $$(go list $(PROJECT)/...|grep -v acceptance ); do \
relname="$${pkg#$(PROJECT)/}" ; \
mkdir -p coverhtml/$$(dirname $${relname}) ; \
go test $(TESTFLAGS) -a -coverprofile=coverhtml/$${relname}.out $$pkg ; \
if [ -f coverhtml/$${relname}.out ] ; then \
go tool cover -html=coverhtml/$${relname}.out -o coverhtml/$${relname}.html ; \
go tool cover -func=coverhtml/$${relname}.out -o coverhtml/$${relname}.txt ; \
fi \
done
format:
go fmt $(PROJECT)/...
check-format:
scripts/check_fmt $(PROJECT)
protocol-diagrams: protocol/state-diag-client.svg protocol/state-diag-session.svg
%.svg: %.gv
# requires graphviz installed
dot -Tsvg $< > $@
.PHONY: bootstrap check check-race format check-format coverage-summary \
coverage-html protocol-diagrams