1
0
mirror of https://github.com/osmarks/ngircd.git synced 2024-10-28 04:46:17 +00:00

Test suite: make expect scripts more verbose

Now tests.sh transforms each expect script it executes using sed(1)
and inserts a 'puts -nonewline stderr "."' in front of each "expect"
command.
This commit is contained in:
Alexander Barton 2012-09-24 23:05:24 +02:00
parent 8bede388af
commit de2fa78d92

View File

@ -34,10 +34,21 @@ if [ $? -ne 0 ]; then
echo "${name}: \"telnet\" not found."; exit 77 echo "${name}: \"telnet\" not found."; exit 77
fi fi
# prepare expect script
e_in="${srcdir}/${test}.e"
e_tmp="${test}.e_"
e_exec="$e_in"
if test -t 1 2>/dev/null; then
sed -e 's|^expect |puts -nonewline stderr "."; expect |g' \
"$e_in" >"$e_tmp"
[ $? -eq 0 ] && e_exec="$e_tmp"
fi
echo_n "running ${test} ..." echo_n "running ${test} ..."
expect ${srcdir}/${test}.e > logs/${test}.log 2>&1; r=$? expect "$e_tmp" > logs/${test}.log; r=$?
[ $r -eq 0 ] && echo " ok." || echo " failure!" [ $r -eq 0 ] && echo " ok." || echo " failure!"
rm -f "$e_tmp"
exit $r exit $r
# -eof- # -eof-