Update tests.sh

This commit is contained in:
Gyu-Ho Lee 2017-02-02 23:59:29 -08:00 committed by GitHub
parent 99535d31f4
commit 9b92606389
1 changed files with 5 additions and 6 deletions

View File

@ -9,17 +9,12 @@ fi
IGNORE_PKGS="(agent|vendor|remotestorage)"
TESTS=`find . -name \*_test.go | while read a; do dirname $a; done | sort | uniq | egrep -v "$IGNORE_PKGS"`
echo "Running tests...";
go test -v $TESTS;
go test -v -race $TESTS;
echo "Checking gofmt..."
fmtRes=$(gofmt -l -s $TESTS 2>&1 >/dev/null)
fmtRes=$(gofmt -l -s -d $TESTS)
if [ -n "${fmtRes}" ]; then
echo -e "gofmt checking failed:\n${fmtRes}"
exit 255
fi
echo "Checking govet..."
vetRes=$(go vet $TESTS 2>&1 >/dev/null)
if [ -n "${vetRes}" ]; then
@ -27,4 +22,8 @@ if [ -n "${vetRes}" ]; then
exit 255
fi
echo "Running tests...";
go test -v $TESTS;
go test -v -race $TESTS;
echo "Success";