#PUNKTEST FIXTURE - owned by src/tests/shell/testsuites/punkexe/scriptexec.test #Do not hand-edit: the suite asserts on the marker and exit behaviour below. #Tk fixture: creates a window and exits 0 from an 'after' callback. The marker #and exit fire ONLY if the event loop is serviced after the script body - which #is the 'script' subcommand's tclsh-matching Tk main-loop behaviour (G-015, #punkshell 0.4.1). Pre-fix, the process exited before the callback ran. #Arg 1 = delay in milliseconds (default 300). if {[catch {package require Tk}]} { puts stderr "PUNKTEST_TK_UNAVAILABLE" exit 2 } set ms [expr {[llength $::argv] ? [lindex $::argv 0] : 300}] label .l -text "punktest countdown" pack .l after $ms { puts "PUNKTEST_TK_DONE" flush stdout exit 0 }