Skip to content

Commit

Permalink
cover: do a cross package coverage
Browse files Browse the repository at this point in the history
Figured out the way to do it much more cheaply, only few % overhead over
normal coverage.

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
  • Loading branch information
Kubuxu committed Dec 19, 2016
1 parent a1f4fae commit fa1ba24
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion coverage/Rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ UCOVER_$(d) := $(addsuffix .coverprofile,$(addprefix $(d)/unitcover/, $(subst /,

$(UCOVER_$(d)): $(d)/coverage_deps ALWAYS
$(eval TMP_PKG := $(subst _,/,$(basename $(@F))))
@go test $(go-flags-with-tags) $(GOTFLAGS) -covermode=atomic -coverprofile=$@ $(TMP_PKG)
$(eval TMP_DEPS := $(shell go list -f '{{range .Deps}}{{.}} {{end}}' $(go-flags-with-tags) $(TMP_PKG) | sed 's/ /\n/g' | grep ipfs/go-ipfs | grep -v ipfs/go-ipfs/Godeps) $(TMP_PKG))
$(eval TMP_DEPS_LIST := $(call join-with,$(comma),$(TMP_DEPS)))
go test $(go-flags-with-tags) $(GOTFLAGS) -covermode=atomic -coverpkg=$(TMP_DEPS_LIST) -coverprofile=$@ $(TMP_PKG)


$(d)/unit_tests.coverprofile: $(UCOVER_$(d))
Expand Down

0 comments on commit fa1ba24

Please sign in to comment.