Index: library/lib/test.tcl =================================================================== diff -u -rd97d44f12168b44adb58f0d66842eb86bfa9d955 -re516122728ddcd7c6d92e43de9cfe497b305bee5 --- library/lib/test.tcl (.../test.tcl) (revision d97d44f12168b44adb58f0d66842eb86bfa9d955) +++ library/lib/test.tcl (.../test.tcl) (revision e516122728ddcd7c6d92e43de9cfe497b305bee5) @@ -90,6 +90,7 @@ } :public method run args { + :exitOn if {[info exists :pre]} {:call "pre" ${:pre}} if {![info exists :msg]} {set :msg ${:cmd}} set gotError [catch {:call "run" ${:cmd}} r] @@ -120,12 +121,32 @@ # [exit -1] would leave us with a partially unwinded callstack # with garbage complicating debugging (e.g. MEM_COUNT # statistics would indicate unbalanced refCounts, etc.). - - return -level [expr {[info level]-1}] -code error + :exit -1 } if {[info exists :post]} {:call "post" ${:post}} + :exitOff } + + :public method exit {{statuscode "1"}} { + array set map {1 ok -1 error} + set errorcode $map($statuscode) + :exitOff + return -code $errorcode -level [expr {[info level]-1}] "Test was exited with code $statuscode" + } + + :public method exitOn {} { + interp hide {} exit; + interp alias {} ::exit {} [current] exit + } + + :public method exitOff {} { + interp alias {} ::exit {} + interp expose {} exit; + } + + } + ::namespace export Test } Index: library/xotcl/tests/xocomm.test =================================================================== diff -u -re02cb00ae815bd6f8561a6a03fceacc13fd91903 -re516122728ddcd7c6d92e43de9cfe497b305bee5 --- library/xotcl/tests/xocomm.test (.../xocomm.test) (revision e02cb00ae815bd6f8561a6a03fceacc13fd91903) +++ library/xotcl/tests/xocomm.test (.../xocomm.test) (revision e516122728ddcd7c6d92e43de9cfe497b305bee5) @@ -101,7 +101,7 @@ nx::Test new -msg terminate -count 1 \ -setResult {set x 1} \ -cmd [list SimpleRequest r0 -url http://$protectedhostport/exit] \ - -post exit + -post {set ::forever 1; exit} after 1000 {nx::Test run} catch {vwait forever} Index: tests/interp.test =================================================================== diff -u -rf34be2f016a50e3f5fc8b1b021e28fb696bdb5de -re516122728ddcd7c6d92e43de9cfe497b305bee5 --- tests/interp.test (.../interp.test) (revision f34be2f016a50e3f5fc8b1b021e28fb696bdb5de) +++ tests/interp.test (.../interp.test) (revision e516122728ddcd7c6d92e43de9cfe497b305bee5) @@ -743,18 +743,6 @@ interp delete $i unset i - - # $i eval { - # nx::Class create ::M2 - # # catch {x mixin add ::M2} msg - # # puts stderr -----msg=$msg - # # TODO: force an invalidation of the mixin order! - # # - # catch { interp invokehidden {} M mixin add M2 } msg - # puts stderr -----msg=$msg,$::errorInfo - # } - # ? {$i eval {x info precedence}} "::M ::nx::Object" - # ? {$i eval {x info mixin classes}} ::M }