-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
24 lines (20 loc) · 969 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
.PHONY: test cover cover-html cover-test
test:
go test `go list ./... | grep -v /vendor/ | grep -v stampzilla-telldus`
# todo: use this when golang issue 23910 is resolved
# go test -v -coverpkg=./... -coverprofile=all `go list ./... | grep -v /vendor/ `
cover:
@echo Running coverage
go install github.com/wadey/gocovmerge@latest
$(eval PKGS := $(shell go list ./... | grep -v /vendor/ ))
$(eval PKGS_DELIM := $(shell echo $(PKGS) | sed -e 's/ /,/g'))
go list -f '{{if or (len .TestGoFiles) (len .XTestGoFiles)}}go test -test.v -test.timeout=120s -covermode=atomic -coverprofile={{.Name}}_{{len .Imports}}_{{len .Deps}}.coverprofile -coverpkg $(PKGS_DELIM) {{.ImportPath}}{{end}}' $(PKGS) | xargs -I {} bash -c {}
gocovmerge `ls *.coverprofile` > coverage.txt
rm *.coverprofile
cover-normal:
bash coverage
cover-html: cover
go tool cover -html coverage.txt
build-ui:
cd nodes/stampzilla-server/public && gulp
cd nodes/stampzilla-server && go generate