Skip to content

Commit 0b552e1

Browse files
committed
fine tune the -coverpkg settings, so that we don’t get any warnings
1 parent ead8f73 commit 0b552e1

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

ci/go_test_multi_package_coverprofile.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,23 @@ coverprofile="$workdir/$coverprofilename.coverprofile"
5555
# Sets -cover.
5656
mode=count
5757

58-
function join { local IFS="$1"; shift; echo "$*"; }
59-
mypkgs=`go list ./...`
60-
mypkgs=`join , $mypkgs`
61-
6258
# functions section
6359
generate_cover_data() {
6460
rm -rf "$workdir"
6561
mkdir "$workdir"
6662

6763
for pkg in "$@"; do
64+
65+
# Make a list of each proj-related package we depend on (plus ourself).
66+
# We will collect coverage stats on all those packages, not just ourself,
67+
# so that we can get coverage data across package boundaries.
68+
mypkgs=$pkg
69+
for i in `go list -f '{{.Deps}}' $pkg` ; do
70+
if [[ "$i" = "github.com/go-spatial/proj"* ]]; then
71+
mypkgs="$mypkgs,$i"
72+
fi
73+
done
74+
6875
f="$workdir/$(echo $pkg | tr / -).pkgcoverprofile"
6976
go test -covermode="$mode" -coverprofile="$f" -coverpkg=$mypkgs "$pkg"
7077
done

0 commit comments

Comments
 (0)