test: update test and coverage calls for newer go versions
parent
160847e116
commit
9c936d4b88
33
Makefile
33
Makefile
|
@ -38,16 +38,14 @@ clean:
|
||||||
rm -f imposm
|
rm -f imposm
|
||||||
(cd test && make clean)
|
(cd test && make clean)
|
||||||
|
|
||||||
test: imposm system-test-files
|
test: system-test-files
|
||||||
$(GO) test $(GOTAGS) -i `$(GO) list ./... | grep -Ev '/vendor'`
|
$(GO) test $(GOTAGS) ./...
|
||||||
$(GO) test $(GOTAGS) `$(GO) list ./... | grep -Ev '/vendor'`
|
|
||||||
|
|
||||||
test-unit: imposm
|
test-unit: system-test-files
|
||||||
$(GO) test $(GOTAGS) -i `$(GO) list ./... | grep -Ev '/test|/vendor'`
|
$(GO) test $(GOTAGS) -test.short ./...
|
||||||
$(GO) test $(GOTAGS) `$(GO) list ./... | grep -Ev '/test|/vendor'`
|
|
||||||
|
|
||||||
test-system: imposm
|
test-system: system-test-files
|
||||||
(cd test && make test)
|
$(GO) test $(GOTAGS) ./test
|
||||||
|
|
||||||
system-test-files:
|
system-test-files:
|
||||||
(cd test && make files)
|
(cd test && make files)
|
||||||
|
@ -77,23 +75,8 @@ build-license-deps:
|
||||||
' _ {} \;
|
' _ {} \;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
comma:= ,
|
|
||||||
empty:=
|
|
||||||
space:= $(empty) $(empty)
|
|
||||||
COVER_IGNORE:='/vendor|/cmd'
|
|
||||||
COVER_PACKAGES:= $(shell $(GO) list ./... | grep -Ev $(COVER_IGNORE))
|
|
||||||
COVER_PACKAGES_LIST:=$(subst $(space),$(comma),$(COVER_PACKAGES))
|
|
||||||
|
|
||||||
test-coverage:
|
test-coverage:
|
||||||
mkdir -p .coverprofile
|
$(GO) test -coverprofile imposm.coverprofile ./...
|
||||||
rm -f .coverprofile/*
|
|
||||||
$(GO) list -f '{{if gt (len .TestGoFiles) 0}}"$(GO) test -covermode count -coverprofile ./.coverprofile/{{.Name}}-$$$$.coverprofile -coverpkg $(COVER_PACKAGES_LIST) {{.ImportPath}}"{{end}}' ./... \
|
|
||||||
| grep -Ev $(COVER_IGNORE) \
|
|
||||||
| xargs -n 1 bash -c
|
|
||||||
$(GOPATH)/bin/gocovmerge .coverprofile/*.coverprofile > overalls.coverprofile
|
|
||||||
rm -rf .coverprofile
|
|
||||||
|
|
||||||
test-coverage-html: test-coverage
|
test-coverage-html: test-coverage
|
||||||
$(GO) tool cover -html overalls.coverprofile
|
$(GO) tool cover -html imposm.coverprofile
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue