From a9dae4611088872d7dc96442a00842059a74b2fa Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Mon, 20 Jul 2015 15:16:41 +0000 Subject: [PATCH] When running unit tests, output coverage for imported modules. --- test/units.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/units.sh b/test/units.sh index 9fa72d852a..b7b6567188 100755 --- a/test/units.sh +++ b/test/units.sh @@ -32,8 +32,9 @@ for dir in $TESTDIRS; do GO_TEST_ARGS_RUN="$GO_TEST_ARGS" if [ -n "$SLOW" ]; then + COVERPKGS=$(go list -f '{{join .Deps "\n"}}' $dir | grep "weaveworks" | paste -s -d,) output=$(mktemp $coverdir/unit.XXXXXXXXXX) - GO_TEST_ARGS_RUN="$GO_TEST_ARGS -coverprofile=$output" + GO_TEST_ARGS_RUN="$GO_TEST_ARGS -coverprofile=$output -coverpkg=$COVERPKGS" fi START=$(date +%s)