diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/all.tcl | 6 | ||||
-rw-r--r-- | tests/appendComp.test | 3 | ||||
-rw-r--r-- | tests/cmdAH.test | 4 | ||||
-rw-r--r-- | tests/cmdMZ.test | 4 | ||||
-rw-r--r-- | tests/compile.test | 4 | ||||
-rw-r--r-- | tests/exec.test | 6 | ||||
-rw-r--r-- | tests/fileName.test | 10 | ||||
-rw-r--r-- | tests/lset.test | 2 | ||||
-rw-r--r-- | tests/macFCmd.test | 12 | ||||
-rw-r--r-- | tests/namespace.test | 4 |
10 files changed, 37 insertions, 18 deletions
diff --git a/tests/all.tcl b/tests/all.tcl index d8dbd25..4c407fb 100644 --- a/tests/all.tcl +++ b/tests/all.tcl @@ -8,11 +8,15 @@ # Copyright (c) 2000 by Ajuba Solutions # All rights reserved. # -# RCS: @(#) $Id: all.tcl,v 1.14 2001/09/11 18:03:05 andreas_kupries Exp $ +# RCS: @(#) $Id: all.tcl,v 1.15 2001/11/23 01:25:35 das Exp $ set tcltestVersion [package require tcltest] namespace import -force tcltest::* +if {$tcl_platform(platform) == "macintosh"} { + tcltest::singleProcess 1 +} + tcltest::testsDirectory [file dir [info script]] tcltest::runAllTests diff --git a/tests/appendComp.test b/tests/appendComp.test index 207a14b..e5c96f8 100644 --- a/tests/appendComp.test +++ b/tests/appendComp.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: appendComp.test,v 1.4 2001/09/12 20:28:50 dgp Exp $ +# RCS: @(#) $Id: appendComp.test,v 1.5 2001/11/23 01:25:38 das Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -355,6 +355,7 @@ catch {unset i x result y} catch {rename foo ""} catch {rename bar ""} catch {rename check ""} +catch {rename bar {}} # cleanup ::tcltest::cleanupTests diff --git a/tests/cmdAH.test b/tests/cmdAH.test index 88272d2..0ebbe48 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: cmdAH.test,v 1.15 2001/09/09 17:32:16 mdejong Exp $ +# RCS: @(#) $Id: cmdAH.test,v 1.16 2001/11/23 01:25:51 das Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -1178,7 +1178,7 @@ test cmdAH-20.3 {Tcl_FileObjCmd: atime} { test cmdAH-20.4 {Tcl_FileObjCmd: atime} { list [catch {file atime $file notint} msg] $msg } {1 {expected integer but got "notint"}} -test cmdAH-20.5 {Tcl_FileObjCmd: atime touch} { +test cmdAH-20.5 {Tcl_FileObjCmd: atime touch} {unixOrPc} { if {[string equal $tcl_platform(platform) "windows"]} { set old [pwd] cd $::tcltest::temporaryDirectory diff --git a/tests/cmdMZ.test b/tests/cmdMZ.test index d2aca4d..d2a57f9 100644 --- a/tests/cmdMZ.test +++ b/tests/cmdMZ.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: cmdMZ.test,v 1.8 2001/05/21 22:33:47 hobbs Exp $ +# RCS: @(#) $Id: cmdMZ.test,v 1.9 2001/11/23 01:25:54 das Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -78,7 +78,7 @@ test cmdMZ-3.1 {Tcl_SourceObjCmd: error conditions} {macOnly} { } {1 {wrong # args: should be "source fileName" or "source -rsrc name ?fileName?" or "source -rsrcid id ?fileName?"}} test cmdMZ-3.2 {Tcl_SourceObjCmd: error conditions} {macOnly} { list [catch {source a b} msg] $msg -} {1 {wrong # args: should be "source fileName" or "source -rsrc name ?fileName?" or "source -rsrcid id ?fileName?"}} +} {1 {bad argument: should be "source fileName" or "source -rsrc name ?fileName?" or "source -rsrcid id ?fileName?"}} test cmdMZ-3.3 {Tcl_SourceObjCmd: error conditions} {unixOrPc} { list [catch {source} msg] $msg } {1 {wrong # args: should be "source fileName"}} diff --git a/tests/compile.test b/tests/compile.test index abadee0..5e77875 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.14 2001/11/19 21:04:42 msofer Exp $ +# RCS: @(#) $Id: compile.test,v 1.15 2001/11/23 01:25:58 das Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -289,7 +289,7 @@ test compile-12.2 {testing error on literal deletion} {memDebug execCommandExist # Special test for underestimating the maxStackSize required for a # compiled command. A failure will cause a segfault in the child # process. -test compile-13.1 {testing underestimate of maxStackSize in list cmd} { +test compile-13.1 {testing underestimate of maxStackSize in list cmd} {execCommandExists} { set body {set x [list} for {set i 0} {$i < 3000} {incr i} { append body " $i" diff --git a/tests/exec.test b/tests/exec.test index af8bf32..9087173 100644 --- a/tests/exec.test +++ b/tests/exec.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: exec.test,v 1.8 2000/04/10 17:18:58 ericm Exp $ +# RCS: @(#) $Id: exec.test,v 1.9 2001/11/23 01:26:02 das Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -228,7 +228,9 @@ test exec-4.5 {redirecting output and stderr to file} {execCommandExists stdio} # I/O redirection: input from file. +if { [set ::tcltest::testConstraints(execCommandExists)] } { exec $::tcltest::tcltest echo "Just a few thoughts" > gorp.file +} test exec-5.1 {redirecting input from file} {execCommandExists stdio} { exec $::tcltest::tcltest cat < gorp.file } {Just a few thoughts} @@ -432,7 +434,9 @@ test exec-11.5 {commands in background} {execCommandExists stdio} { # Make sure that background commands are properly reaped when # they eventually die. +if { [set ::tcltest::testConstraints(execCommandExists)] } { exec $::tcltest::tcltest sleep 3 +} test exec-12.1 {reaping background processes} \ {execCommandExists stdio unixOnly nonPortable} { for {set i 0} {$i < 20} {incr i} { diff --git a/tests/fileName.test b/tests/fileName.test index 757a8d9..b7616f3 100644 --- a/tests/fileName.test +++ b/tests/fileName.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: fileName.test,v 1.15 2001/10/29 15:02:44 vincentdarley Exp $ +# RCS: @(#) $Id: fileName.test,v 1.16 2001/11/23 01:26:06 das Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -304,6 +304,11 @@ test filename-4.18 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split foo/bar~/baz } {foo bar~ baz} + +if {[tcltest::testConstraint testsetplatform]} { + testsetplatform $platform +} + test filename-4.19 {Tcl_SplitPath} { set oldDir [pwd] set res [catch { @@ -317,6 +322,7 @@ test filename-4.19 {Tcl_SplitPath} { set idx [string first tildetmp $norm] set norm [string range $norm $idx end] # fix path away so all platforms are the same + regsub {(.*):$} $norm {\1} norm regsub -all ":" $norm "/" norm # make sure we can delete the directory we created cd $oldDir @@ -1717,7 +1723,7 @@ test filename-16.13 {windows specific globbing} {pcOnly sharedCdrive} { } //[info hostname]/c/globTest # cleanup -file delete -force C:/globTest +catch {file delete -force C:/globTest} cd $oldDir file delete -force globTest set env(HOME) $oldhome diff --git a/tests/lset.test b/tests/lset.test index 0e70357..6bf412f 100644 --- a/tests/lset.test +++ b/tests/lset.test @@ -449,6 +449,8 @@ test lset-14.2 {lset, not compiled, flat args, is string rep preserved?} { catch {unset noRead} catch {unset noWrite} catch {rename failTrace {}} +catch {unset ::x} +catch {unset ::y} # cleanup ::tcltest::cleanupTests diff --git a/tests/macFCmd.test b/tests/macFCmd.test index 52182b0..275c466 100644 --- a/tests/macFCmd.test +++ b/tests/macFCmd.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: macFCmd.test,v 1.7 2000/04/10 17:19:02 ericm Exp $ +# RCS: @(#) $Id: macFCmd.test,v 1.8 2001/11/23 01:26:14 das Exp $ # if {[lsearch [namespace children] ::tcltest] == -1} { @@ -32,7 +32,7 @@ file delete -force foo.dir test macFCmd-1.1 {GetFileFinderAttributes - no file} {macOnly} { catch {file delete -force foo.file} list [catch {file attributes foo.file -creator} msg] $msg -} {1 {could not read ":foo.file": no such file or directory}} +} {1 {could not read "foo.file": no such file or directory}} test macFCmd-1.2 {GetFileFinderAttributes - creator} {macOnly} { catch {file delete -force foo.file} catch {close [open foo.file w]} @@ -80,7 +80,7 @@ test macFCmd-1.8 {GetFileFinderAttributes - folder hidden} {macOnly} { test macFCmd-2.1 {GetFileReadOnly - bad file} {macOnly} { catch {file delete -force foo.file} list [catch {file attributes foo.file -readonly} msg] $msg -} {1 {could not read ":foo.file": no such file or directory}} +} {1 {could not read "foo.file": no such file or directory}} test macFCmd-2.2 {GetFileReadOnly - file not read only} {macOnly} { catch {file delete -force foo.file} close [open foo.file w] @@ -111,7 +111,7 @@ test macFCmd-2.5 {GetFileReadOnly - directory read only} {macOnly fileSharing} { test macFCmd-3.1 {SetFileFinderAttributes - bad file} {macOnly} { catch {file delete -force foo.file} list [catch {file attributes foo.file -creator FOOO} msg] $msg -} {1 {could not read ":foo.file": no such file or directory}} +} {1 {could not read "foo.file": no such file or directory}} test macFCmd-3.2 {SetFileFinderAttributes - creator} {macOnly} { catch {file delete -force foo.file} close [open foo.file w] @@ -147,12 +147,12 @@ test macFCmd-3.7 {SetFileFinderAttributes - directory} {macOnly} { file mkdir foo.dir list [catch {file attributes foo.dir -creator FOOO} msg] \ $msg [file delete -force foo.dir] -} {1 {cannot set -creator: ":foo.dir" is a directory} {}} +} {1 {cannot set -creator: "foo.dir" is a directory} {}} test macFCmd-4.1 {SetFileReadOnly - bad file} {macOnly} { catch {file delete -force foo.file} list [catch {file attributes foo.file -readonly 1} msg] $msg -} {1 {could not read ":foo.file": no such file or directory}} +} {1 {could not read "foo.file": no such file or directory}} test macFCmd-4.2 {SetFileReadOnly - file not readonly} {macOnly} { catch {file delete -force foo.file} close [open foo.file w] diff --git a/tests/namespace.test b/tests/namespace.test index 303ec84..76e7425 100644 --- a/tests/namespace.test +++ b/tests/namespace.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: namespace.test,v 1.17 2001/09/12 20:28:50 dgp Exp $ +# RCS: @(#) $Id: namespace.test,v 1.18 2001/11/23 01:26:27 das Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -1137,6 +1137,7 @@ test namespace-40.1 {Ignoring namespace proc "unknown"} { } {global global} test namespace-41.1 {Shadowing byte-compiled commands} { + set res {} namespace eval ns { set res {} proc test {} { @@ -1148,6 +1149,7 @@ test namespace-41.1 {Shadowing byte-compiled commands} { } lappend ::res [test] } + namespace delete ns set res } {0 1} |