summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhershey <hershey>1998-07-28 11:08:25 (GMT)
committerhershey <hershey>1998-07-28 11:08:25 (GMT)
commit39297f4d688d9dd85ac96585a3747a2a69ecc378 (patch)
treecef3c225b0557de91c036689a934c3fe0840b930
parentb58c7260ecf6cdb6a6a3ebf94e64da146b4105dc (diff)
downloadtcl-39297f4d688d9dd85ac96585a3747a2a69ecc378.zip
tcl-39297f4d688d9dd85ac96585a3747a2a69ecc378.tar.gz
tcl-39297f4d688d9dd85ac96585a3747a2a69ecc378.tar.bz2
checks for existence of test commands
-rw-r--r--tests/expr-old.test11
-rw-r--r--tests/ioUtil.test18
-rw-r--r--tests/var.test5
3 files changed, 31 insertions, 3 deletions
diff --git a/tests/expr-old.test b/tests/expr-old.test
index 8fb8ad9..e11ecd2 100644
--- a/tests/expr-old.test
+++ b/tests/expr-old.test
@@ -900,15 +900,24 @@ test expr-old-36.10 {ExprLooksLikeInt procedure} {nonPortable unixOnly} {
list [catch {expr 78e} msg] $msg
} {1 {syntax error in expression "78e"}}
+if {[info commands testexprlong] == {}} {
+ puts "This application hasn't been compiled with the \"testexprlong\""
+ puts "command, so I can't test Tcl_ExprLong etc."
+} else {
test expr-old-37.1 {Check that Tcl_ExprLong doesn't modify interpreter result if no error} {
testexprlong
} {This is a result: 5}
+}
+if {[info commands testexprstring] == {}} {
+ puts "This application hasn't been compiled with the \"testexprstring\""
+ puts "command, so I can't test Tcl_ExprString etc."
+} else {
test expr-old-38.1 {Verify Tcl_ExprString's basic operation} {
list [testexprstring "1+4"] [testexprstring "2*3+4.2"] \
[catch {testexprstring "1+"} msg] $msg
} {5 10.2 1 {syntax error in expression "1+"}}
-
+}
# Special test for Pentium arithmetic bug of 1994:
diff --git a/tests/ioUtil.test b/tests/ioUtil.test
index 2b2e60d..f7a2999 100644
--- a/tests/ioUtil.test
+++ b/tests/ioUtil.test
@@ -8,7 +8,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# SCCS: %Z% $Id: ioUtil.test,v 1.2 1998/07/13 14:04:50 suresh Exp $
+# SCCS: %Z% $Id: ioUtil.test,v 1.3 1998/07/28 11:09:15 hershey Exp $
if {[string compare test [info procs test]] == 1} then {source defs}
@@ -25,6 +25,10 @@ test stat-1.1 {TclStat: Check that none of the test procs are there.} {
list $err1 $err2 $err3
} {{couldn't stat "testStat1%.fil": no such file or directory} {couldn't stat "testStat2%.fil": no such file or directory} {couldn't stat "testStat3%.fil": no such file or directory}}
+if {[info commands teststatproc] == {}} {
+ puts "This application hasn't been compiled with the \"teststatproc\""
+ puts "command, so I can't test Tcl_Stat_* etc."
+} else {
test stat-1.2 {TclStatInsertProc: Insert the 3 test TclStat_ procedures.} {
catch {teststatproc insert TclpStat} err1
teststatproc insert TestStatProc1
@@ -100,6 +104,7 @@ test stat-1.8 {TclStatDeleteProc: Verify that all procs have been deleted.} {
list $err9 $err10 $err11
} {{"TestStatProc1": could not be deleteed} {"TestStatProc2": could not be deleteed} {"TestStatProc3": could not be deleteed}}
+}
eval $unsetScript
@@ -111,6 +116,10 @@ test access-1.1 {TclAccess: Check that none of the test procs are there.} {
list $err1 $err2 $err3
} {0 0 0}
+if {[info commands testaccessproc] == {}} {
+ puts "This application hasn't been compiled with the \"testaccessproc\""
+ puts "command, so I can't test Tcl_Access_* etc."
+} else {
test access-1.2 {TclAccessInsertProc: Insert the 3 test TclAccess_ procedures.} {
catch {testaccessproc insert TclpAccess} err1
testaccessproc insert TestAccessProc1
@@ -177,7 +186,7 @@ test access-1.8 {TclAccessDeleteProc: Verify that all procs have been deleted.}
list $err9 $err10 $err11
} {{"TestAccessProc1": could not be deleteed} {"TestAccessProc2": could not be deleteed} {"TestAccessProc3": could not be deleteed}}
-
+}
test openfilechannel-1.1 {TclOpenFileChannel: Check that none of the test procs are there.} {
catch {file exists __testOpenFileChannel1%__.fil} err1
@@ -189,6 +198,10 @@ test openfilechannel-1.1 {TclOpenFileChannel: Check that none of the test procs
list $err1 $err2 $err3 $err4 $err5 $err6
} {0 0 0 0 0 0}
+if {[info commands testopenfilechannelproc] == {}} {
+ puts "This application hasn't been compiled with the \"testopenfilechannelproc\""
+ puts "command, so I can't test Tcl_OpenFileChannelInsert"
+} else {
test openfilechannel-1.2 {TclOpenFileChannelInsertProc: Insert the 3 test TclOpenFileChannel_ procedures.} {
catch {testopenfilechannelproc insert TclpOpenFileChannel} err1
testopenfilechannelproc insert TestOpenFileChannelProc1
@@ -284,3 +297,4 @@ test openfilechannel-1.8 {TclOpenFileChannelDeleteProc: Verify that all procs ha
list $err9 $err10 $err11
} {{"TestOpenFileChannelProc1": could not be deleteed} {"TestOpenFileChannelProc2": could not be deleteed} {"TestOpenFileChannelProc3": could not be deleteed}}
+}
diff --git a/tests/var.test b/tests/var.test
index 6452577..93a66d1 100644
--- a/tests/var.test
+++ b/tests/var.test
@@ -407,6 +407,10 @@ test var-8.1 {TclDeleteVars, "unset" traces are called with fully-qualified var
list [unset test_ns_var::v] $test_ns_var::info
} {{} {test_ns_var::v {} u}}
+if {[info commands testsetnoerr] == {}} {
+ puts "This application hasn't been compiled with the \"testsetnoerr\""
+ puts "command, so I can't test TclSetVar etc."
+} else {
test var-9.1 {behaviour of TclSetVar without TCL_LEAVE_ERR_MSG flag} {
testsetnoerr v 1
} 1
@@ -449,6 +453,7 @@ test var-9.9 {behaviour of TclSetVar without TCL_LEAVE_ERR_MSG flag} {
trace var v w readonly
list [catch {testsetnoerr v 2} msg] $msg
} {1 {before set}}
+}
catch {namespace delete ns}
catch {unset arr}