Index: library/lib/nx-test.tcl =================================================================== diff -u -r464ec0a020a47ef504e143ad0e0c5d0990044488 -r5ab2ad98d7e3d8509a26ea32ec64fa9cc78af2f8 --- library/lib/nx-test.tcl (.../nx-test.tcl) (revision 464ec0a020a47ef504e143ad0e0c5d0990044488) +++ library/lib/nx-test.tcl (.../nx-test.tcl) (revision 5ab2ad98d7e3d8509a26ea32ec64fa9cc78af2f8) @@ -123,12 +123,29 @@ :exitOn if {[info exists :pre]} {:call "pre" ${:pre}} if {![info exists :msg]} {set :msg ${:cmd}} - set gotError [catch {:call "run" ${:cmd}} r] + #set gotError [catch {:call "run" ${:cmd}} r] + try { + :call run ${:cmd} + } on error {errorMsg opts} { + set errorCode [dict get $opts -errorcode] + if {$errorCode ne "NONE"} { + set r $errorMsg + } else { + set r $errorMsg + } + set gotError 1 + } on ok {r} { + set gotError 0 + set errorCode "NONE" + } #puts stderr "gotError = $gotError // $r == ${:expected} // [info exists :setResult]" if {[info exists :setResult]} {set r [eval [set :setResult]]} - if {$r eq ${:expected}} { + if {$r eq ${:expected} || $errorCode eq ${:expected}} { if {$gotError} { set c 1 + if {$errorCode ne "NONE" && $errorCode ne ${:expected}} { + puts stderr "[set :name] hint: we could compare with errorCode: $errorCode" + } } else { if {[info exists :count]} {set c ${:count}} {set c 1000} }