4 # Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 # Please read the file COPYING, README and AUTHORS for more information.
13 # detect source directory
14 [ -z "$srcdir" ] && srcdir=`dirname $0`
17 test=`echo ${name} | cut -d '.' -f 1`
18 [ -d logs ] || mkdir logs
20 if [ ! -r "$test" ]; then
21 echo "${name}: test \"$test\" not found!"; exit 77
26 . ${srcdir}/functions.inc
28 type expect > /dev/null 2>&1
30 echo "${name}: \"expect\" not found."; exit 77
32 type telnet > /dev/null 2>&1
34 echo "${name}: \"telnet\" not found."; exit 77
37 # prepare expect script
38 e_in="${srcdir}/${test}.e"
41 if test -t 1 2>/dev/null; then
42 sed -e 's|^expect |puts -nonewline stderr "."; expect |g' \
44 [ $? -eq 0 ] && e_exec="$e_tmp"
47 echo_n "running ${test} ..."
48 expect "$e_exec" > logs/${test}.log; r=$?
49 [ $r -eq 0 ] && echo " ok." || echo " failure!"