2017-02-09 15:29:17 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
echo "mode: count" > fullcov.out
|
|
|
|
dirs=$(find ./* -maxdepth 10 -type d )
|
|
|
|
dirs=". $dirs"
|
|
|
|
for dir in $dirs;
|
|
|
|
do
|
|
|
|
if ls "$dir"/*.go &> /dev/null;
|
|
|
|
then
|
2017-02-14 18:26:48 +00:00
|
|
|
go test -v -coverprofile=profile.out -covermode=count -tags silent "$dir"
|
2017-02-09 15:29:17 +00:00
|
|
|
if [ $? -ne 0 ];
|
|
|
|
then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if [ -f profile.out ]
|
|
|
|
then
|
|
|
|
cat profile.out | grep -v "^mode: count" >> fullcov.out
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
2017-03-27 10:16:45 +00:00
|
|
|
|
|
|
|
if [ -n $COVERALLS_TOKEN ];
|
|
|
|
then
|
|
|
|
$HOME/gopath/bin/goveralls -coverprofile=fullcov.out -service=travis-ci -repotoken $COVERALLS_TOKEN
|
|
|
|
fi
|
2017-02-09 15:29:17 +00:00
|
|
|
rm -rf ./profile.out
|
|
|
|
rm -rf ./fullcov.out
|