fixed tests not working with the normal 'make testall'

This commit is contained in:
Markus Makela
2014-09-16 20:02:28 +03:00
parent 81b83f1978
commit 8b1afbfe26
6 changed files with 219 additions and 159 deletions

View File

@ -1,24 +1,32 @@
#!/bin/bash
NARGS=7
THOST=$1
TPORT=$2
TMASTER_ID=$3
TUSER=$4
TPWD=$5
TESTINPUT=$6
DIR=$7
NARGS=8
TLOG=$1
THOST=$2
TPORT=$3
TMASTER_ID=$4
TUSER=$5
TPWD=$6
TESTINPUT=$7
if [ $# != $NARGS ] ;
if [ $# -lt $(( NARGS - 1 )) ] ;
then
echo""
echo "Wrong number of arguments, gave "$#" but "$NARGS" is required"
echo "Wrong number of arguments, gave "$#" but "$(( NARGS - 1 ))" is required"
echo ""
echo "Usage :"
echo " rwsplit_hints.sh <host> <port> <master id> <user> <password> <test file> <script directory>"
echo " rwsplit_hints.sh <log filename> <host> <port> <master id> <user> <password> <test file>"
echo ""
exit 1
fi
if [ $# -eq $NARGS ]
then
TDIR=$8
else
TDIR=.
fi
TESTINPUT=$TDIR/$TESTINPUT
RUNCMD=mysql\ --host=$THOST\ -P$TPORT\ -u$TUSER\ -p$TPWD\ --unbuffered=true\ --disable-reconnect\ --silent\ --comment
i=0
@ -43,7 +51,7 @@ crash=0
if [ "$TOUTPUT" != "${TRETVAL[x]}" -a "${TRETVAL[x]}" != "" ]
then
all_passed=0
echo "$TESTINPUT:$((x + 1)): ${TINPUT[x]} FAILED, return value $TOUTPUT when ${TRETVAL[x]} was expected";
echo "$TESTINPUT:$((x + 1)): ${TINPUT[x]} FAILED, return value $TOUTPUT when ${TRETVAL[x]} was expected">>$TLOG;
fi
x=$((x+1))
done < $TESTINPUT.output
@ -53,15 +61,18 @@ then
all_passed=0
for ((v=0;v<$i;v++))
do
echo "${TINPUT[v]} FAILED, nothing was returned";
echo "${TINPUT[v]} FAILED, nothing was returned">>$TLOG;
done
fi
if [ $all_passed -eq 1 ]
then
echo "Test set: PASSED";
exit 0
echo "Test set: PASSED">>$TLOG;
else
echo "Test set: FAILED";
exit 1
echo "Test set: FAILED">>$TLOG;
fi
if [ $# -eq $NARGS ]
then
cat $TLOG
fi