diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-06-20 20:50:48 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-06-20 20:50:48 (GMT) |
commit | efcc2252599e8e2e97a97a4c1d28b138ac31e520 (patch) | |
tree | b6fc50833b38b61331ded4df2b5e4d8332316685 /library | |
parent | 24b0f264c3d39f99abfaeb34757ccc32e093ff61 (diff) | |
download | tcl-efcc2252599e8e2e97a97a4c1d28b138ac31e520.zip tcl-efcc2252599e8e2e97a97a4c1d28b138ac31e520.tar.gz tcl-efcc2252599e8e2e97a97a4c1d28b138ac31e520.tar.bz2 |
previous commit was not quite right, this one should be better
Diffstat (limited to 'library')
-rw-r--r-- | library/tcltest/tcltest.tcl | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index 7dd969b..22d79e1 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -1991,20 +1991,6 @@ proc tcltest::test {name description args} { } } - # check if the return code matched the expected return code - set codeFailure 0 - if {!$setupFailure && ($returnCode ni $returnCodes)} { - set codeFailure 1 - } - - # Always run the cleanup script - set code [catch {uplevel 1 $cleanup} cleanupMsg] - if {$code == 1} { - set errorInfo(cleanup) $::errorInfo - set errorCode(cleanup) $::errorCode - } - set cleanupFailure [expr {$code != 0}] - set coreFailure 0 set coreMsg "" # check for a core file first - if one was created by the test, @@ -2038,6 +2024,12 @@ proc tcltest::test {name description args} { } } + # check if the return code matched the expected return code + set codeFailure 0 + if {!$setupFailure && ($returnCode ni $returnCodes)} { + set codeFailure 1 + } + # If expected output/error strings exist, we have to compare # them. If the comparison fails, then so did the test. set outputFailure 0 @@ -2076,6 +2068,14 @@ proc tcltest::test {name description args} { set scriptFailure 1 } + # Always run the cleanup script + set code [catch {uplevel 1 $cleanup} cleanupMsg] + if {$code == 1} { + set errorInfo(cleanup) $::errorInfo + set errorCode(cleanup) $::errorCode + } + set cleanupFailure [expr {$code != 0}] + # if we didn't experience any failures, then we passed variable numTests if {!($setupFailure || $cleanupFailure || $coreFailure |