From: Ian Jackson Date: Thu, 29 Oct 2015 01:57:00 +0000 (+0000) Subject: Testing: Move expect_before timeout to right place X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=cgi-auth-flexible.git;a=commitdiff_plain;h=a2d1d2c00b41c075fd61c899c8884c2012817343;ds=sidebyside Testing: Move expect_before timeout to right place Otherwise it relates to the default spawn id which is stdin. The effect is that (a) the timeout is for the whole script, not each expect, and (b) when stdin is /dev/null Tcl gets EOF, closes it, and then complains error writing "stdout": bad file number (which is rather daft). Signed-off-by: Ian Jackson --- diff --git a/tests/autotest b/tests/autotest index f2b2870..60ef3ff 100755 --- a/tests/autotest +++ b/tests/autotest @@ -31,9 +31,7 @@ proc timeout-abort {} { send_log "\r\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" error "aborting due to timeout" } -set timeout 15 - -expect_after timeout timeout-abort +set timeout 10 proc elog {args} { set m "[list expect [lindex $args end]]" @@ -57,6 +55,8 @@ proc dospawn {} { spawn -nottycopy \ w3m -config /dev/null -o cgi_bin=$pwd/tests file:///cgi-bin/wrap/Tsuffix + expect_after timeout timeout-abort + epage {You need to log in} }