diff options
author | ferrieux <ferrieux@users.sourceforge.net> | 2014-09-03 19:44:29 (GMT) |
---|---|---|
committer | ferrieux <ferrieux@users.sourceforge.net> | 2014-09-03 19:44:29 (GMT) |
commit | 8d5c986031606a4565659bb82dcbba7ab9ce0186 (patch) | |
tree | c808e91d72076f1c9bb2dc9f27e66b30175a6334 /tests/aaa_exit.test | |
parent | 497aa76e901586dee5b41e797c50da9fb9d8f569 (diff) | |
download | tcl-8d5c986031606a4565659bb82dcbba7ab9ce0186.zip tcl-8d5c986031606a4565659bb82dcbba7ab9ce0186.tar.gz tcl-8d5c986031606a4565659bb82dcbba7ab9ce0186.tar.bz2 |
Distinguish hanging from crashing in exit tests.
Diffstat (limited to 'tests/aaa_exit.test')
-rw-r--r-- | tests/aaa_exit.test | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/tests/aaa_exit.test b/tests/aaa_exit.test index 51a94d7..3ba5167 100644 --- a/tests/aaa_exit.test +++ b/tests/aaa_exit.test @@ -16,22 +16,35 @@ if {[lsearch [namespace children] ::tcltest] == -1} { namespace import -force ::tcltest::* } - test exit-1.1 {normal, quick exit} { - set f [open "|[interpreter] << \"exec [interpreter] << {set ::env(TCL_FINALIZE_ON_EXIT) 0;exit}\" 2>@ stderr" r] - set aft [after 5000 {set done "Quick exit hangs !!!"}] + set f [open "|[interpreter] << \"exec [interpreter] << {set ::env(TCL_FINALIZE_ON_EXIT) 0;exit}\"" r] + set aft [after 1000 {set done "Quick exit hangs !!!"}] fileevent $f readable {after cancel $aft;set done OK} vwait done - catch {fconfigure $f -blocking 0;close $f} + if {$done != "OK"} { + fconfigure $f -blocking 0 + close $f + } else { + if {[catch {close $f} err]} { + set done "Quick exit misbehaves: $err" + } + } set done } OK test exit-1.2 {full-finalized exit} { - set f [open "|[interpreter] << \"exec [interpreter] << {set ::env(TCL_FINALIZE_ON_EXIT) 1;exit}\" 2>@ stderr" r] - set aft [after 5000 {set done "Full-finalized exit hangs !!!"}] + set f [open "|[interpreter] << \"exec [interpreter] << {set ::env(TCL_FINALIZE_ON_EXIT) 1;exit}\"" r] + set aft [after 1000 {set done "Full-finalized exit hangs !!!"}] fileevent $f readable {after cancel $aft;set done OK} vwait done - catch {fconfigure $f -blocking 0;close $f} + if {$done != "OK"} { + fconfigure $f -blocking 0 + close $f + } else { + if {[catch {close $f} err]} { + set done "Full-finalized exit misbehaves: $err" + } + } set done } OK |