Module: ngircd.git Branch: master Commit: de2fa78d92447d2acc3d349b8044524f5b616f59 URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=de2fa...
Author: Alexander Barton alex@barton.de Date: Mon Sep 24 23:05:24 2012 +0200
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.
---
src/testsuite/tests.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/testsuite/tests.sh b/src/testsuite/tests.sh index f820628..8ecf8ab 100755 --- a/src/testsuite/tests.sh +++ b/src/testsuite/tests.sh @@ -34,10 +34,21 @@ if [ $? -ne 0 ]; then echo "${name}: "telnet" not found."; exit 77 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} ..." -expect ${srcdir}/${test}.e > logs/${test}.log 2>&1; r=$? +expect "$e_tmp" > logs/${test}.log; r=$? [ $r -eq 0 ] && echo " ok." || echo " failure!"
+rm -f "$e_tmp" exit $r
# -eof-