summaryrefslogtreecommitdiffstats
path: root/tests/trace.test
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2007-06-15 19:58:12 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2007-06-15 19:58:12 (GMT)
commit0ea1a219a60d3bc60a8ee100c215597ee9d3e9d7 (patch)
tree114caa92372378b34872fb87a22a3b9063b08f63 /tests/trace.test
parent86011ea4066f2ab0939bb04f67619c14d867d7b3 (diff)
downloadtcl-0ea1a219a60d3bc60a8ee100c215597ee9d3e9d7.zip
tcl-0ea1a219a60d3bc60a8ee100c215597ee9d3e9d7.tar.gz
tcl-0ea1a219a60d3bc60a8ee100c215597ee9d3e9d7.tar.bz2
* generic/tclCompile.c: reverted TclEvalObjvInternal and
* generic/tclExecute.c: INST_INVOKE to essentially what they were * generic/tclBasic.c: previous to the commit of 2007-04-03 [Patch 1693802] and the subsequent optimisations, as they break the new trace tests described below. * generic/trace.test: added tests 36 to 38 for dynamic trace creation and addition. These tests expose a change in dynamics due to a recent round of optimisations. The "correct" behaviour is not described in docs nor TIP 62.
Diffstat (limited to 'tests/trace.test')
-rw-r--r--tests/trace.test75
1 files changed, 47 insertions, 28 deletions
diff --git a/tests/trace.test b/tests/trace.test
index 539188e..212968a 100644
--- a/tests/trace.test
+++ b/tests/trace.test
@@ -11,7 +11,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: trace.test,v 1.53 2007/06/15 18:14:14 msofer Exp $
+# RCS: @(#) $Id: trace.test,v 1.54 2007/06/15 19:58:13 msofer Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -2477,42 +2477,57 @@ proc untraced {type} {
trace add execution untraced $type {traceproc tracevar}
append ::tracevar -
}
-
+proc runbase {results base} {
+ set tt {enter leave enterstep leavestep}
+ foreach n {1 2 3 4} t $tt r $results {
+ eval [subst $base]
+ }
+}
set base {
- test trace-36.%N% {dynamic trace creation: %T%} -setup {
+ test trace-36.$n {dynamic trace creation: $t} -setup {
set ::tracevar {}
} -cleanup {
unset ::tracevar
- trace remove execution untraced %T% {traceproc tracevar}
+ trace remove execution untraced $t {traceproc tracevar}
} -body {
- untraced %T%
+ untraced $t
set ::tracevar
- } -result %R%
+ } -result {$r}
}
+runbase {- -* - -} $base
-foreach n {
- 1 2 3 4
-} t {
- enter leave enterstep leavestep
-} r {
- - -* - -
-} {
- set smap [list %N% $n %T% $t %R% $r]
- eval [string map $smap $base]
+set base {
+ test trace-37.$n {dynamic trace addition: $t} -setup {
+ set ::tracevar {}
+ set ::tracevar2 {}
+ trace add execution untraced enter {traceproc tracevar2}
+ } -cleanup {
+ trace remove execution untraced $t {traceproc tracevar}
+ trace remove execution untraced enter {traceproc tracevar2}
+ unset ::tracevar ::tracevar2
+ } -body {
+ untraced $t
+ list \$::tracevar \$::tracevar2
+ } -result {$r}
}
+runbase {{- *} {-* *} {- *} {- *}} $base
+
+set base {
+ test trace-38.$n {dynamic trace addition: $t} -setup {
+ set ::tracevar {}
+ set ::tracevar2 {}
+ trace add execution untraced leave {traceproc tracevar2}
+ } -cleanup {
+ trace remove execution untraced $t {traceproc tracevar}
+ trace remove execution untraced leave {traceproc tracevar2}
+ unset ::tracevar ::tracevar2
+ } -body {
+ untraced $t
+ list \$::tracevar \$::tracevar2
+ } -result {$r}
+}
+runbase {{- *} {-* *} {- *} {- *}} $base
-test trace-36.5 {dynamic trace addition} -setup {
- set ::tracevar {}
- set ::tracevar2 {}
- trace add execution untraced leave {traceproc tracevar2}
-} -cleanup {
- trace remove execution untraced leave {traceproc tracevar}
- trace remove execution untraced leave {traceproc tracevar2}
-} -body {
- untraced leave
- list $::tracevar $::tracevar2
-} -result {-* *}
-
# Delete procedures when done, so we don't clash with other tests
@@ -2520,9 +2535,13 @@ test trace-36.5 {dynamic trace addition} -setup {
catch {rename foobar {}}
catch {rename foo {}}
catch {rename bar {}}
+catch {rename untraced {}}
+catch {rename traceproc {}}
+catch {rename runbase {}}
-# Unset the varaible when done
+# Unset the variable when done
catch {unset info}
+catch {unset base}
# cleanup
::tcltest::cleanupTests