diff options
author | pooryorick <com.digitalsmarties@pooryorick.com> | 2019-12-01 19:45:54 (GMT) |
---|---|---|
committer | pooryorick <com.digitalsmarties@pooryorick.com> | 2019-12-01 19:45:54 (GMT) |
commit | 506589f483df5a96c589137d19d963d42372921e (patch) | |
tree | e480a767b4502a92724de85859c00c42e2fbfb89 /library | |
parent | d138d28133e65fbabfecdf4ed817196b81debc81 (diff) | |
download | tcl-506589f483df5a96c589137d19d963d42372921e.zip tcl-506589f483df5a96c589137d19d963d42372921e.tar.gz tcl-506589f483df5a96c589137d19d963d42372921e.tar.bz2 |
Add tcltest::EvalTest to make it easier to customize behaviour.
Diffstat (limited to 'library')
-rw-r--r-- | library/tcltest/tcltest.tcl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index 820e978..67a8eb6 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -2358,12 +2358,21 @@ proc tcltest::RunTest {name script} { memory tag $name } - set code [catch {uplevel 1 $script} actualAnswer] + set code [catch {uplevel 1 [list [ + namespace origin EvalTest] $script]} actualAnswer copts] return [list $actualAnswer $code] } +proc tcltest::EvalTest script { + set code [catch {uplevel 1 $script} cres copts] + dict set copts -code $code + dict incr copts -level + return -options $copts $cres +} + + # SetupTest -- # |