summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2001-10-12 21:04:15 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2001-10-12 21:04:15 (GMT)
commite5900506a58fda182c5bb74dc837a90964a6c365 (patch)
tree5dfaec292c3aedb71766f68f7e506f2a2005f0b6 /tests
parent2b38dab02e370539c53bd464c558256f7fd2d17b (diff)
downloadtcl-e5900506a58fda182c5bb74dc837a90964a6c365.zip
tcl-e5900506a58fda182c5bb74dc837a90964a6c365.tar.gz
tcl-e5900506a58fda182c5bb74dc837a90964a6c365.tar.bz2
Small modif to tests/compile.test: better constraint handling for
tests committed earlier today.
Diffstat (limited to 'tests')
-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 {}