summaryrefslogtreecommitdiffstats
path: root/library/tcltest/tcltest.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'library/tcltest/tcltest.tcl')
-rw-r--r--library/tcltest/tcltest.tcl16
1 files changed, 15 insertions, 1 deletions
diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl
index a7a68c7..820e978 100644
--- a/library/tcltest/tcltest.tcl
+++ b/library/tcltest/tcltest.tcl
@@ -1983,7 +1983,9 @@ proc tcltest::test {name description args} {
}
# First, run the setup script
- set code [catch {uplevel 1 $setup} setupMsg]
+ set code [catch {
+ uplevel 1 [list [namespace which SetupTest] $setup]
+ } setupMsg]
if {$code == 1} {
set errorInfo(setup) $::errorInfo
set errorCodeRes(setup) $::errorCode
@@ -2338,6 +2340,8 @@ proc tcltest::Skipped {name constraints} {
return 0
}
+
+
# RunTest --
#
# This is where the body of a test is evaluated. The combination of
@@ -2359,6 +2363,16 @@ proc tcltest::RunTest {name script} {
return [list $actualAnswer $code]
}
+
+
+# SetupTest --
+#
+# Evaluates the -setup script for a test
+
+proc tcltest::SetupTest setup {
+ uplevel 1 $setup
+}
+
#####################################################################
# tcltest::cleanupTestsHook --