Skip to content

Commit

Permalink
Merge pull request #22 from dstdfx/fix-test-script
Browse files Browse the repository at this point in the history
Fix gotest.sh
  • Loading branch information
dstdfx authored Jun 12, 2020
2 parents 4bef232 + b4c81eb commit 1aa00d4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion scripts/gotest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@

echo "==> Running go test and creating a coverage profile..."
i=0
failed=0
for testingpkg in $(go list ./pkg/.../testing); do
coverpkg=${testingpkg::-8}
go test -v -covermode count -coverprofile "./${i}.coverprofile" -coverpkg $coverpkg $testingpkg
if [ $? -eq 1 ]; then
failed+=1
fi
((i++))
done
gocovmerge $(ls ./*.coverprofile) > coverage.out
rm *.coverprofile
rm *.coverprofile

if ((failed>0)); then
exit 1
fi
exit 0

0 comments on commit 1aa00d4

Please sign in to comment.