1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-11-14 15:45:34 -05:00

coverall script

This commit is contained in:
V2Ray
2015-09-07 21:22:43 +02:00
parent bdeee46839
commit 7f54ba8f6b
2 changed files with 26 additions and 4 deletions

25
testing/coverage/coverall Normal file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
echo "mode: set" > coverall.out
fail=0
for dir in $(find . -maxdepth 10 -not -path './.git*' -type d);
do
if ls $dir/*.go &> /dev/null; then
go test -coverprofile=coversingle.out $dir || fail=1
if [ -f coversingle.out ]
then
cat coversingle.out | grep -v "mode: set" >> coverall.out
rm coversingle.out
fi
fi
done
if [ "$fail" -eq 0 ]
then
$HOME/gopath/bin/goveralls -v -coverprofile=acc.out -service=travis-ci -repotoken $COVERALLS_TOKEN
fi
rm -f coverall.out
exit $fail