a better way to restrict coverage

this better fixes #1524.
This commit is contained in:
Matthias Radestock committed 2015-10-12 18:04:07 +01:00
1 parent 0ff01871f3
commit 1d00bdd2a4
1 file changed
+3 -1
+3 -1
View File
@@ -45,6 +45,8 @@ NETGO_CHECK=@strings $@ | grep cgo_stub\\\.go >/dev/null || { \
}
BUILD_FLAGS=-ldflags "-extldflags \"-static\" -X main.version $(WEAVE_VERSION)" -tags netgo
PACKAGE_BASE=$(shell go list -e ./)
all: $(WEAVE_EXPORT) $(RUNNER_EXE)
travis: $(EXES)
@@ -54,7 +56,7 @@ update:
$(WEAVER_EXE) $(WEAVEPROXY_EXE): common/*.go common/*/*.go net/*.go
ifeq ($(COVERAGE),true)
$(eval COVERAGE_MODULES := $(shell (go list ./$(@D); go list -f '{{join .Deps "\n"}}' ./$(@D) | grep "^github.com/weaveworks/weave/") | paste -s -d,))
$(eval COVERAGE_MODULES := $(shell (go list ./$(@D); go list -f '{{join .Deps "\n"}}' ./$(@D) | grep "^$(PACKAGE_BASE)/") | paste -s -d,))
go get -t -tags netgo ./$(@D)
go test -c -o ./$@ $(BUILD_FLAGS) -v -covermode=atomic -coverpkg $(COVERAGE_MODULES) ./$(@D)/
else