-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add workaround and test for workaround
- Loading branch information
1 parent
f1807a9
commit e0905da
Showing
4 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cover.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.PHONY: deps workaround | ||
|
||
deps: | ||
go get github.com/wadey/gocovmerge | ||
|
||
workaround: deps | ||
@echo Running tests | ||
$(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 -covermode=count -coverprofile={{.Name}}_{{len .Imports}}_{{len .Deps}}.coverprofile -coverpkg $(PKGS_DELIM) {{.ImportPath}}{{end}}' $(PKGS) | xargs -I {} bash -c {} | ||
gocovmerge `ls *.coverprofile` > cover.out | ||
rm *.coverprofile | ||
|
||
testworkaround: workaround | ||
diff -u cover.out cover.ok |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
mode: count | ||
github.com/haya14busa/go-cover-multi-pkgs-example/root.go:5.24,7.2 1 1 | ||
github.com/haya14busa/go-cover-multi-pkgs-example/root.go:9.17,12.2 2 1 | ||
github.com/haya14busa/go-cover-multi-pkgs-example/sub/sub.go:3.23,5.2 1 1 | ||
github.com/haya14busa/go-cover-multi-pkgs-example/sub/sub.go:7.24,9.2 1 1 | ||
github.com/haya14busa/go-cover-multi-pkgs-example/sub/sub.go:11.30,13.2 1 2 |