summaryrefslogtreecommitdiffstats
path: root/tests/trace.test
diff options
context:
space:
mode:
authormig <mig>2012-02-06 16:43:46 (GMT)
committermig <mig>2012-02-06 16:43:46 (GMT)
commit3726e1f19cfa86bd6348c60bc1b600512748db4f (patch)
tree13aebbdee5531d588f3da83aea837ff321dba2af /tests/trace.test
parentf6491ee624f67b79e27052355b92065d83cf48ec (diff)
downloadtcl-3726e1f19cfa86bd6348c60bc1b600512748db4f.zip
tcl-3726e1f19cfa86bd6348c60bc1b600512748db4f.tar.gz
tcl-3726e1f19cfa86bd6348c60bc1b600512748db4f.tar.bz2
Fix for [Bug 3484621]: insure that execution traces on bytecoded commands
bump the interp's compile epoch.
Diffstat (limited to 'tests/trace.test')
-rw-r--r--tests/trace.test33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/trace.test b/tests/trace.test
index c2a760d..3297258 100644
--- a/tests/trace.test
+++ b/tests/trace.test
@@ -2558,6 +2558,39 @@ set base {
}
runbase {{- *} {-* *} {- *} {- *}} $base
+test trace-39 {bug #3484621: tracing Bc'ed commands} -setup {
+ set ::traceLog 0
+ set ::traceCalls 0
+ set ::bar [list 0 1 2 3]
+ set res {}
+ proc dotrace args {
+ incr ::traceLog
+ }
+ proc foo {} {
+ incr ::traceCalls
+ # choose a BC'ed command that is 'unlikely' to interfere with tcltest's
+ # internals
+ lset ::bar 1 2
+ }
+} -body {
+ foo
+ lappend res $::traceLog
+
+ trace add execution lset enter dotrace
+ foo
+ lappend res $::traceLog
+
+ trace remove execution lset enter dotrace
+ foo
+ lappend res $::traceLog
+
+ list $::traceCalls | {*}$res
+} -cleanup {
+ unset ::traceLog ::traceCalls ::bar res
+ rename dotrace {}
+ rename foo {}
+} -result {3 | 0 1 1}
+
# Delete procedures when done, so we don't clash with other tests