summaryrefslogtreecommitdiffstats
path: root/tests/compile.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/compile.test')
-rw-r--r--tests/compile.test45
1 files changed, 21 insertions, 24 deletions
diff --git a/tests/compile.test b/tests/compile.test
index ae3bfd4..dfa5770 100644
--- a/tests/compile.test
+++ b/tests/compile.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: compile.test,v 1.12 2001/10/12 16:13:32 msofer Exp $
+# RCS: @(#) $Id: compile.test,v 1.13 2001/10/12 21:04:15 msofer Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -247,34 +247,31 @@ test compile-11.9 {Tcl_Append*: ensure Tcl_ResetResult is used properly} {
# with TCL_MEM_DEBUG
#
# Special test for leak on interp delete [Bug 467523].
-test compile-12.1 {testing literal leak on interp delete} {
- if {[llength [info commands memory]]} {
- proc getbytes {} {
- set lines [split [memory info] "\n"]
- lindex [lindex $lines 3] 3
- }
-
- set end [getbytes]
- for {set i 0} {$i < 5} {incr i} {
- interp create foo
- foo eval {
- namespace eval bar {}
- }
- interp delete foo
- set tmp $end
- set end [getbytes]
- }
+set ::tcltest::testConstraints(execCommandExists) [expr {[info commands exec] != ""}]
+set ::tcltest::testConstraints(memDebug) [expr {[info commands memory] != ""}]
- set leak [expr {$end - $tmp}]
- rename getbytes {}
- } else {
- set leak 0
+test compile-12.1 {testing literal leak on interp delete} {memDebug} {
+ proc getbytes {} {
+ set lines [split [memory info] "\n"]
+ lindex [lindex $lines 3] 3
}
- set leak
+
+ set end [getbytes]
+ for {set i 0} {$i < 5} {incr i} {
+ interp create foo
+ foo eval {
+ namespace eval bar {}
+ }
+ interp delete foo
+ set tmp $end
+ set end [getbytes]
+ }
+ rename getbytes {}
+ set leak [expr {$end - $tmp}]
} 0
# Special test for a memory error in a preliminary fix of [Bug 467523].
# It requires executing a helpfile
-test compile-12.2 {testing error on literal deletion} {
+test compile-12.2 {testing error on literal deletion} {memDebug execCommandExists} {
makeFile {
for {set i 0} {$i < 5} {incr i} {
namespace eval bar {}