2 c4d78a34 2002-09-09 alex # ngIRCd Test Suite
3 450251f0 2004-09-06 alex # $Id: tests.sh,v 1.7 2004/09/06 22:04:06 alex Exp $
5 9ddb9347 2004-09-04 alex # detect source directory
6 9ddb9347 2004-09-04 alex [ -z "$srcdir" ] && srcdir=`dirname $0`
8 c4d78a34 2002-09-09 alex name=`basename $0`
9 c4d78a34 2002-09-09 alex test=`echo ${name} | cut -d '.' -f 1`
10 fc6f6474 2002-09-09 alex mkdir -p logs
12 c5bdd86f 2004-09-04 alex if [ ! -r "$test" ]; then
13 c5bdd86f 2004-09-04 alex echo " ${name}: test \"$test\" not found!"; exit 77
17 450251f0 2004-09-06 alex # read in functions
18 450251f0 2004-09-06 alex . ${srcdir}/functions.inc
20 c4d78a34 2002-09-09 alex type expect > /dev/null 2>&1
21 c4d78a34 2002-09-09 alex if [ $? -ne 0 ]; then
22 1ed708ef 2003-08-22 alex echo " ${name}: \"expect\" not found."; exit 77
24 fc6f6474 2002-09-09 alex type telnet > /dev/null 2>&1
25 fc6f6474 2002-09-09 alex if [ $? -ne 0 ]; then
26 1ed708ef 2003-08-22 alex echo " ${name}: \"telnet\" not found."; exit 77
29 450251f0 2004-09-06 alex echo_n " running ${test} ..."
30 c5bdd86f 2004-09-04 alex expect ${srcdir}/${test}.e > logs/${test}.log 2>&1; r=$?
31 c5bdd86f 2004-09-04 alex [ $r -eq 0 ] && echo " ok." || echo " failure!"