test: update test and coverage calls for newer go versions

master
Oliver Tonnhofer 2018-06-05 21:05:06 +02:00
parent 160847e116
commit 9c936d4b88
1 changed files with 8 additions and 25 deletions

View File

@ -38,16 +38,14 @@ clean:
rm -f imposm
(cd test && make clean)
test: imposm system-test-files
$(GO) test $(GOTAGS) -i `$(GO) list ./... | grep -Ev '/vendor'`
$(GO) test $(GOTAGS) `$(GO) list ./... | grep -Ev '/vendor'`
test: system-test-files
$(GO) test $(GOTAGS) ./...
test-unit: imposm
$(GO) test $(GOTAGS) -i `$(GO) list ./... | grep -Ev '/test|/vendor'`
$(GO) test $(GOTAGS) `$(GO) list ./... | grep -Ev '/test|/vendor'`
test-unit: system-test-files
$(GO) test $(GOTAGS) -test.short ./...
test-system: imposm
(cd test && make test)
test-system: system-test-files
$(GO) test $(GOTAGS) ./test
system-test-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:
mkdir -p .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
$(GO) test -coverprofile imposm.coverprofile ./...
test-coverage-html: test-coverage
$(GO) tool cover -html overalls.coverprofile
$(GO) tool cover -html imposm.coverprofile