diff options
| author | pooryorick <com.digitalsmarties@pooryorick.com> | 2019-12-01 12:16:04 (GMT) |
|---|---|---|
| committer | pooryorick <com.digitalsmarties@pooryorick.com> | 2019-12-01 12:16:04 (GMT) |
| commit | af1ecf410ef2f7ec370c16a9a1c24951a61d1f42 (patch) | |
| tree | c67616195ec2b8db6167344b2e697f02067bbb33 | |
| parent | 09abed41d6fdf4d24fbefdc354959b7c77ce7d90 (diff) | |
| parent | 3435c9713f7b20d9061a5b2758728e66846c8989 (diff) | |
| download | tcl-af1ecf410ef2f7ec370c16a9a1c24951a61d1f42.zip tcl-af1ecf410ef2f7ec370c16a9a1c24951a61d1f42.tar.gz tcl-af1ecf410ef2f7ec370c16a9a1c24951a61d1f42.tar.bz2 | |
merge 8.6
| -rw-r--r-- | library/tcltest/tcltest.tcl | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index a7a68c7..2d36d13 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -1983,7 +1983,8 @@ proc tcltest::test {name description args} { } # First, run the setup script - set code [catch {uplevel 1 $setup} setupMsg] + lassign [uplevel 1 [list [ + namespace which SetupScript] $setup]] code setupMsg if {$code == 1} { set errorInfo(setup) $::errorInfo set errorCodeRes(setup) $::errorCode @@ -2338,6 +2339,8 @@ proc tcltest::Skipped {name constraints} { return 0 } + + # RunTest -- # # This is where the body of a test is evaluated. The combination of @@ -2359,6 +2362,19 @@ proc tcltest::RunTest {name script} { return [list $actualAnswer $code] } + + +# SetupTest -- +# +# Evaluates the -setup script for a test + +proc tcltest::SetupTest {name script} { + DebugPuts 3 [list Setup Script for $name $script] + + set code [catch {uplevel 1 $setup} setupMsg] + return [list $code $setupMsg] +} + ##################################################################### # tcltest::cleanupTestsHook -- |
