tendermint/test/test_libs.sh

51 lines
1.0 KiB
Bash
Raw Normal View History

2016-07-23 09:48:30 -07:00
#! /bin/bash
2016-12-08 22:28:08 -08:00
set -e
2016-07-23 09:48:30 -07:00
# set glide.lock path
if [[ "$GLIDE" == "" ]]; then
GLIDE=$GOPATH/src/github.com/tendermint/tendermint/glide.lock
fi
# get vendored commit for given lib
####################
# libs we depend on
####################
2017-04-20 14:56:35 -07:00
# some libs are tested with go, others with make
# TODO: should be all make (post repo merge)
2017-04-21 15:12:54 -07:00
LIBS_GO_TEST=(tmlibs/clist tmlibs/common go-config go-crypto tmlibs/db tmlibs/events go-merkle go-p2p)
2017-01-12 12:53:32 -08:00
LIBS_MAKE_TEST=(go-rpc go-wire abci)
2016-07-23 09:48:30 -07:00
for lib in "${LIBS_GO_TEST[@]}"; do
2016-10-12 09:28:34 -07:00
# checkout vendored version of lib
2017-02-20 15:51:00 -08:00
bash scripts/glide/checkout.sh "$GLIDE" "$lib"
2016-07-23 09:48:30 -07:00
echo "Testing $lib ..."
2017-02-20 15:51:00 -08:00
go test -v --race "github.com/tendermint/$lib/..."
2016-07-23 09:48:30 -07:00
if [[ "$?" != 0 ]]; then
echo "FAIL"
exit 1
fi
done
2017-02-20 15:51:00 -08:00
DIR=$(pwd)
2016-07-23 09:48:30 -07:00
for lib in "${LIBS_MAKE_TEST[@]}"; do
2016-12-08 22:28:08 -08:00
# checkout vendored version of lib
2017-02-20 15:51:00 -08:00
bash scripts/glide/checkout.sh "$GLIDE" "$lib"
2016-07-23 09:48:30 -07:00
echo "Testing $lib ..."
2017-02-20 15:51:00 -08:00
cd "$GOPATH/src/github.com/tendermint/$lib"
2016-07-23 09:48:30 -07:00
make test
if [[ "$?" != 0 ]]; then
echo "FAIL"
exit 1
fi
2017-02-20 15:51:00 -08:00
cd "$DIR"
2016-07-23 09:48:30 -07:00
done
echo ""
echo "PASS"