2014-07-23 00:16:54 +08:00
|
|
|
#!/bin/bash
|
2014-10-31 07:06:04 +08:00
|
|
|
PACKAGES=('gobot' 'gobot/api' 'gobot/platforms/intel-iot/edison' 'gobot/sysfs' $(ls ./platforms | sed -e 's/^/gobot\/platforms\//'))
|
2014-07-23 00:16:54 +08:00
|
|
|
EXITCODE=0
|
|
|
|
|
2014-12-17 07:38:28 +08:00
|
|
|
go get code.google.com/p/go.tools/cmd/cover
|
|
|
|
|
|
|
|
go test -cover github.com/hybridgroup/gobot
|
|
|
|
|
|
|
|
if [ $? -ne 0 ]
|
2014-11-10 07:46:38 +08:00
|
|
|
then
|
2014-11-10 07:52:41 +08:00
|
|
|
go get golang.org/x/tools/cmd/cover
|
2014-11-10 07:46:38 +08:00
|
|
|
fi
|
|
|
|
|
2014-12-20 03:26:44 +08:00
|
|
|
echo "mode: set" > profile.cov
|
2014-07-23 00:16:54 +08:00
|
|
|
touch tmp.cov
|
|
|
|
for package in "${PACKAGES[@]}"
|
|
|
|
do
|
2014-12-20 03:03:13 +08:00
|
|
|
go test -a -coverprofile=tmp.cov github.com/hybridgroup/$package
|
2014-07-23 00:16:54 +08:00
|
|
|
if [ $? -ne 0 ]
|
|
|
|
then
|
|
|
|
EXITCODE=1
|
|
|
|
fi
|
2014-12-20 03:26:44 +08:00
|
|
|
cat tmp.cov | grep -v "mode: set" >> profile.cov
|
2014-07-23 00:16:54 +08:00
|
|
|
done
|
|
|
|
|
|
|
|
if [ $EXITCODE -ne 0 ]
|
|
|
|
then
|
|
|
|
exit $EXITCODE
|
|
|
|
fi
|
|
|
|
|
|
|
|
export PATH=$PATH:$HOME/gopath/bin/
|
|
|
|
goveralls -coverprofile=profile.cov -service=travis-ci -repotoken=sFrR9ZmLP5FLc34lOaqir67RPzYOvFPUB
|