diff options
author | stanton <stanton> | 1999-04-16 00:46:29 (GMT) |
---|---|---|
committer | stanton <stanton> | 1999-04-16 00:46:29 (GMT) |
commit | 97464e6cba8eb0008cf2727c15718671992b913f (patch) | |
tree | ce9959f2747257d98d52ec8d18bf3b0de99b9535 /tests/winFCmd.test | |
parent | a8c96ddb94d1483a9de5e340b740cb74ef6cafa7 (diff) | |
download | tcl-97464e6cba8eb0008cf2727c15718671992b913f.zip tcl-97464e6cba8eb0008cf2727c15718671992b913f.tar.gz tcl-97464e6cba8eb0008cf2727c15718671992b913f.tar.bz2 |
merged tcl 8.1 branch back into the main trunk
Diffstat (limited to 'tests/winFCmd.test')
-rw-r--r-- | tests/winFCmd.test | 419 |
1 files changed, 209 insertions, 210 deletions
diff --git a/tests/winFCmd.test b/tests/winFCmd.test index dad71e9..935198e 100644 --- a/tests/winFCmd.test +++ b/tests/winFCmd.test @@ -5,17 +5,16 @@ # generates output for errors. No output means no errors were found. # # Copyright (c) 1996-1997 Sun Microsystems, Inc. +# Copyright (c) 1998-1999 by Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: winFCmd.test,v 1.3 1999/02/02 23:01:42 stanton Exp $ +# RCS: @(#) $Id: winFCmd.test,v 1.4 1999/04/16 00:47:37 stanton Exp $ # -if {[string compare test [info procs test]] == 1} then {source defs} - -if {$tcl_platform(platform) != "windows"} { - return +if {[lsearch [namespace children] ::tcltest] == -1} { + source [file join [pwd] [file dirname [info script]] defs.tcl] } proc createfile {file {string a}} { @@ -44,9 +43,8 @@ proc cleanup {args} { } } -set testConfig(cdrom) 0 -set testConfig(exdev) 0 -set testConfig(UNCPath} 0 +set ::tcltest::testConfig(cdrom) 0 +set ::tcltest::testConfig(exdev) 0 # find a CD-ROM so we can test read-only filesystems. @@ -85,11 +83,8 @@ proc findfile {dir} { return "" } -if {$cdrom == ""} { - puts "Couldn't find a CD-ROM. Skipping tests that access CD-ROM." - puts "If you have a CD-ROM, insert a data disk and rerun tests." -} else { - set testConfig(cdrom) 1 +if {$cdrom != ""} { + set ::tcltest::testConfig(cdrom) 1 set cdfile [findfile $cdrom] } @@ -97,21 +92,17 @@ if {[file exists c:/] && [file exists d:/]} { catch {file delete d:/tf1} if {[catch {close [open d:/tf1 w]}] == 0} { file delete d:/tf1 - set testConfig(exdev) 1 + set ::tcltest::testConfig(exdev) 1 } } -if {[file exists //bisque/icepick]} { - set testConfig(UNCPath) 1 -} - file delete -force -- td1 set foo [catch {open td1 w} testfile] if {$foo} { - set testConfig(longFileNames) 0 + set ::tcltest::testConfig(longFileNames) 0 } else { close $testfile - set testConfig(longFileNames) 1 + set ::tcltest::testConfig(longFileNames) 1 file delete -force -- td1 } @@ -131,67 +122,64 @@ append longname $longname # it can be difficult to actually forward "insane" arguments to the # low-level posix emulation layer. -test winFCmd-1.1 {TclpRenameFile: errno: EACCES} {cdrom} { +test winFCmd-1.1 {TclpRenameFile: errno: EACCES} {pcOnly cdrom} { list [catch {testfile mv $cdfile $cdrom/dummy~~.fil} msg] $msg } {1 EACCES} -test winFCmd-1.2 {TclpRenameFile: errno: EEXIST} { +test winFCmd-1.2 {TclpRenameFile: errno: EEXIST} {pcOnly} { cleanup file mkdir td1/td2/td3 file mkdir td2 list [catch {testfile mv td2 td1/td2} msg] $msg } {1 EEXIST} -test winFCmd-1.3 {TclpRenameFile: errno: EINVAL} {!$testConfig(win32s) || ("[lindex [file split [pwd]] end]" == "C:/")} { - # Don't run this test under Win32s on a drive mounted from an NT - # machine; it causes the NT machine to die. - +test winFCmd-1.3 {TclpRenameFile: errno: EINVAL} {pcOnly} { cleanup list [catch {testfile mv / td1} msg] $msg } {1 EINVAL} -test winFCmd-1.4 {TclpRenameFile: errno: EINVAL} { +test winFCmd-1.4 {TclpRenameFile: errno: EINVAL} {pcOnly} { cleanup file mkdir td1 list [catch {testfile mv td1 td1/td2} msg] $msg } {1 EINVAL} -test winFCmd-1.5 {TclpRenameFile: errno: EISDIR} { +test winFCmd-1.5 {TclpRenameFile: errno: EISDIR} {pcOnly} { cleanup file mkdir td1 createfile tf1 list [catch {testfile mv tf1 td1} msg] $msg } {1 EISDIR} -test winFCmd-1.6 {TclpRenameFile: errno: ENOENT} { +test winFCmd-1.6 {TclpRenameFile: errno: ENOENT} {pcOnly} { cleanup list [catch {testfile mv tf1 tf2} msg] $msg } {1 ENOENT} -test winFCmd-1.7 {TclpRenameFile: errno: ENOENT} { +test winFCmd-1.7 {TclpRenameFile: errno: ENOENT} {pcOnly} { cleanup list [catch {testfile mv "" tf2} msg] $msg } {1 ENOENT} -test winFCmd-1.8 {TclpRenameFile: errno: ENOENT} { +test winFCmd-1.8 {TclpRenameFile: errno: ENOENT} {pcOnly} { cleanup createfile tf1 list [catch {testfile mv tf1 ""} msg] $msg } {1 ENOENT} -test winFCmd-1.9 {TclpRenameFile: errno: ENOTDIR} { +test winFCmd-1.9 {TclpRenameFile: errno: ENOTDIR} {pcOnly} { cleanup file mkdir td1 createfile tf1 list [catch {testfile mv td1 tf1} msg] $msg } {1 ENOTDIR} -test winFCmd-1.10 {TclpRenameFile: errno: EXDEV} {exdev} { +test winFCmd-1.10 {TclpRenameFile: errno: EXDEV} {pcOnly exdev} { file delete -force d:/tf1 file mkdir c:/tf1 set msg [list [catch {testfile mv c:/tf1 d:/tf1} msg] $msg] file delete -force c:/tf1 set msg } {1 EXDEV} -test winFCmd-1.11 {TclpRenameFile: errno: EACCES} { +test winFCmd-1.11 {TclpRenameFile: errno: EACCES} {pcOnly} { cleanup set fd [open tf1 w] set msg [list [catch {testfile mv tf1 tf2} msg] $msg] close $fd set msg } {1 EACCES} -test winFCmd-1.12 {TclpRenameFile: errno: EACCES} { +test winFCmd-1.12 {TclpRenameFile: errno: EACCES} {pcOnly} { cleanup createfile tf1 set fd [open tf2 w] @@ -199,7 +187,7 @@ test winFCmd-1.12 {TclpRenameFile: errno: EACCES} { close $fd set msg } {1 EACCES} -test winFCmd-1.13 {TclpRenameFile: errno: EACCES} { +test winFCmd-1.13 {TclpRenameFile: errno: EACCES} {pcOnly} { cleanup list [catch {testfile mv nul tf1} msg] $msg } {1 EACCES} @@ -213,109 +201,99 @@ test winFCmd-1.15 {TclpRenameFile: errno: EEXIST} {nt} { createfile tf1 list [catch {testfile mv tf1 nul} msg] $msg } {1 EEXIST} -test winFCmd-1.16 {TclpRenameFile: MoveFile() != FALSE} { +test winFCmd-1.16 {TclpRenameFile: MoveFile() != FALSE} {pcOnly} { cleanup createfile tf1 tf1 testfile mv tf1 tf2 list [file exists tf1] [contents tf2] } {0 tf1} -test winFCmd-1.17 {TclpRenameFile: MoveFile() == FALSE} { +test winFCmd-1.17 {TclpRenameFile: MoveFile() == FALSE} {pcOnly} { cleanup list [catch {testfile mv tf1 tf2} msg] $msg } {1 ENOENT} -test winFCmd-1.18 {TclpRenameFile: srcAttr == -1} { +test winFCmd-1.18 {TclpRenameFile: srcAttr == -1} {pcOnly} { cleanup list [catch {testfile mv tf1 tf2} msg] $msg } {1 ENOENT} -test winFCmd-1.19 {TclpRenameFile: errno == EACCES} { +test winFCmd-1.19 {TclpRenameFile: errno == EACCES} {pcOnly} { cleanup list [catch {testfile mv nul tf1} msg] $msg } {1 EACCES} -# under 95, this would actually succed and move the current dir out from -# under yourself. -test winFCmd-1.20 {TclpRenameFile: src is dir} {!95} { +test winFCmd-1.20 {TclpRenameFile: src is dir} {nt} { + # under 95, this would actually succeed and move the current dir out from + # under the current process! cleanup file delete /tf1 list [catch {testfile mv [pwd] /tf1} msg] $msg } {1 EACCES} -test winFCmd-1.21 {TclpRenameFile: obscenely long src} {!win32s} { - # Really long file names cause all the file system calls to lock up, - # endlessly throwing an access violation and retrying the operation. - +test winFCmd-1.21 {TclpRenameFile: long src} {pcOnly} { + cleanup list [catch {testfile mv $longname tf1} msg] $msg } {1 ENAMETOOLONG} -test winFCmd-1.22 {TclpRenameFile: obscenely long dst} {nt} { - # return ENOENT if name is too long! - cleanup - createfile tf1 - list [catch {testfile mv tf1 $longname} msg] $msg -} {1 ENOENT} -test winFCmd-1.23 {TclpRenameFile: obscenely long dst} {95} { +test winFCmd-1.22 {TclpRenameFile: long dst} {pcOnly} { cleanup createfile tf1 list [catch {testfile mv tf1 $longname} msg] $msg } {1 ENAMETOOLONG} -test winFCmd-1.24 {TclpRenameFile: move dir into self} { +test winFCmd-1.23 {TclpRenameFile: move dir into self} {pcOnly} { cleanup file mkdir td1 list [catch {testfile mv [pwd]/td1 td1/td2} msg] $msg } {1 EINVAL} -test winFCmd-1.25 {TclpRenameFile: move a root dir} {!$testConfig(win32s) || ("[lindex [file split [pwd]] end]" == "C:/")} { - # Don't run this test under Win32s on a drive mounted from an NT - # machine; it causes the NT machine to die. - +test winFCmd-1.24 {TclpRenameFile: move a root dir} {pcOnly} { cleanup list [catch {testfile mv / c:/} msg] $msg } {1 EINVAL} -test winFCmd-1.26 {TclpRenameFile: cross file systems} {cdrom} { +test winFCmd-1.25 {TclpRenameFile: cross file systems} {pcOnly cdrom} { cleanup file mkdir td1 list [catch {testfile mv td1 $cdrom/td1} msg] $msg } {1 EXDEV} -test winFCmd-1.27 {TclpRenameFile: readonly fs} {cdrom} { +test winFCmd-1.26 {TclpRenameFile: readonly fs} {pcOnly cdrom} { cleanup list [catch {testfile mv $cdfile $cdrom/dummy~~.fil} msg] $msg } {1 EACCES} -test winFCmd-1.28 {TclpRenameFile: open file} { +test winFCmd-1.27 {TclpRenameFile: open file} {pcOnly} { cleanup set fd [open tf1 w] set msg [list [catch {testfile mv tf1 tf2} msg] $msg] close $fd set msg } {1 EACCES} -test winFCmd-1.29 {TclpRenameFile: errno == EEXIST} { +test winFCmd-1.28 {TclpRenameFile: errno == EEXIST} {pcOnly} { cleanup createfile tf1 createfile tf2 testfile mv tf1 tf2 list [file exist tf1] [file exist tf2] } {0 1} -test winFCmd-1.30 {TclpRenameFile: src is dir} { +test winFCmd-1.29 {TclpRenameFile: src is dir} {pcOnly} { cleanup file mkdir td1 createfile tf1 list [catch {testfile mv td1 tf1} msg] $msg } {1 ENOTDIR} -test winFCmd-1.31 {TclpRenameFile: dst is dir} { +test winFCmd-1.30 {TclpRenameFile: dst is dir} {pcOnly} { cleanup file mkdir td1 file mkdir td2/td2 list [catch {testfile mv td1 td2} msg] $msg } {1 EEXIST} -test winFCmd-1.32 {TclpRenameFile: TclpRemoveDirectory fails} { +test winFCmd-1.31 {TclpRenameFile: TclpRemoveDirectory fails} {pcOnly} { cleanup file mkdir td1 file mkdir td2/td2 list [catch {testfile mv td1 td2} msg] $msg } {1 EEXIST} -test winFCmd-1.33 {TclpRenameFile: TclpRemoveDirectory succeeds} { +test winFCmd-1.32 {TclpRenameFile: TclpRemoveDirectory succeeds} {pcOnly} { cleanup file mkdir td1/td2 file mkdir td2 testfile mv td1 td2 list [file exist td1] [file exist td2] [file exist td2/td2] } {0 1 1} -test winFCmd-1.34 {TclpRenameFile: After removing dst dir, MoveFile fails} {exdev} { +test winFCmd-1.33 {TclpRenameFile: After removing dst dir, MoveFile fails} \ + {pcOnly exdev} { file mkdir d:/td1 testchmod 000 d:/td1 set msg [list [catch {testfile mv c:/windows d:/td1} msg] $msg] @@ -323,56 +301,56 @@ test winFCmd-1.34 {TclpRenameFile: After removing dst dir, MoveFile fails} {exde file delete d:/td1 set msg } {1 EXDEV 0} -test winFCmd-1.35 {TclpRenameFile: src is dir, dst is not} { +test winFCmd-1.34 {TclpRenameFile: src is dir, dst is not} {pcOnly} { file mkdir td1 createfile tf1 list [catch {testfile mv td1 tf1} msg] $msg } {1 ENOTDIR} -test winFCmd-1.36 {TclpRenameFile: src is not dir, dst is} { +test winFCmd-1.35 {TclpRenameFile: src is not dir, dst is} {pcOnly} { file mkdir td1 createfile tf1 list [catch {testfile mv tf1 td1} msg] $msg } {1 EISDIR} -test winFCmd-1.37 {TclpRenameFile: src and dst not dir} { +test winFCmd-1.36 {TclpRenameFile: src and dst not dir} {pcOnly} { createfile tf1 tf1 createfile tf2 tf2 testfile mv tf1 tf2 contents tf2 } {tf1} -test winFCmd-1.38 {TclpRenameFile: need to restore temp file} { +test winFCmd-1.37 {TclpRenameFile: need to restore temp file} {pcOnly} { # Can't figure out how to cause this. # Need a file that can't be copied. } {} -test winFCmd-2.1 {TclpCopyFile: errno: EACCES} {cdrom} { +test winFCmd-2.1 {TclpCopyFile: errno: EACCES} {pcOnly cdrom} { cleanup list [catch {testfile cp $cdfile $cdrom/dummy~~.fil} msg] $msg } {1 EACCES} -test winFCmd-2.2 {TclpCopyFile: errno: EISDIR} { +test winFCmd-2.2 {TclpCopyFile: errno: EISDIR} {pcOnly} { cleanup file mkdir td1 list [catch {testfile cp td1 tf1} msg] $msg } {1 EISDIR} -test winFCmd-2.3 {TclpCopyFile: errno: EISDIR} { +test winFCmd-2.3 {TclpCopyFile: errno: EISDIR} {pcOnly} { cleanup createfile tf1 file mkdir td1 list [catch {testfile cp tf1 td1} msg] $msg } {1 EISDIR} -test winFCmd-2.4 {TclpCopyFile: errno: ENOENT} { +test winFCmd-2.4 {TclpCopyFile: errno: ENOENT} {pcOnly} { cleanup list [catch {testfile cp tf1 tf2} msg] $msg } {1 ENOENT} -test winFCmd-2.5 {TclpCopyFile: errno: ENOENT} { +test winFCmd-2.5 {TclpCopyFile: errno: ENOENT} {pcOnly} { cleanup list [catch {testfile cp "" tf2} msg] $msg } {1 ENOENT} -test winFCmd-2.6 {TclpCopyFile: errno: ENOENT} { +test winFCmd-2.6 {TclpCopyFile: errno: ENOENT} {pcOnly} { cleanup createfile tf1 list [catch {testfile cp tf1 ""} msg] $msg } {1 ENOENT} -test winFCmd-2.7 {TclpCopyFile: errno: EACCES} {!nt} { +test winFCmd-2.7 {TclpCopyFile: errno: EACCES} {95} { cleanup createfile tf1 set fd [open tf2 w] @@ -388,49 +366,49 @@ test winFCmd-2.9 {TclpCopyFile: errno: ENOENT} {95} { cleanup list [catch {testfile cp nul tf1} msg] $msg } {1 ENOENT} -test winFCmd-2.10 {TclpCopyFile: CopyFile succeeds} { +test winFCmd-2.10 {TclpCopyFile: CopyFile succeeds} {pcOnly} { cleanup createfile tf1 tf1 testfile cp tf1 tf2 list [contents tf1] [contents tf2] } {tf1 tf1} -test winFCmd-2.11 {TclpCopyFile: CopyFile succeeds} { +test winFCmd-2.11 {TclpCopyFile: CopyFile succeeds} {pcOnly} { cleanup createfile tf1 tf1 createfile tf2 tf2 testfile cp tf1 tf2 list [contents tf1] [contents tf2] } {tf1 tf1} -test winFCmd-2.12 {TclpCopyFile: CopyFile succeeds} { +test winFCmd-2.12 {TclpCopyFile: CopyFile succeeds} {pcOnly} { cleanup createfile tf1 tf1 testchmod 000 tf1 testfile cp tf1 tf2 list [contents tf2] [file writable tf2] } {tf1 0} -test winFCmd-2.13 {TclpCopyFile: CopyFile fails} { +test winFCmd-2.13 {TclpCopyFile: CopyFile fails} {pcOnly} { cleanup createfile tf1 file mkdir td1 list [catch {testfile cp tf1 td1} msg] $msg } {1 EISDIR} -test winFCmd-2.14 {TclpCopyFile: errno == EACCES} { +test winFCmd-2.14 {TclpCopyFile: errno == EACCES} {pcOnly} { cleanup file mkdir td1 list [catch {testfile cp td1 tf1} msg] $msg } {1 EISDIR} -test winFCmd-2.15 {TclpCopyFile: src is directory} { +test winFCmd-2.15 {TclpCopyFile: src is directory} {pcOnly} { cleanup file mkdir td1 list [catch {testfile cp td1 tf1} msg] $msg } {1 EISDIR} -test winFCmd-2.16 {TclpCopyFile: dst is directory} { +test winFCmd-2.16 {TclpCopyFile: dst is directory} {pcOnly} { cleanup createfile tf1 file mkdir td1 list [catch {testfile cp tf1 td1} msg] $msg } {1 EISDIR} -test winFCmd-2.17 {TclpCopyFile: dst is readonly} { +test winFCmd-2.17 {TclpCopyFile: dst is readonly} {pcOnly} { cleanup createfile tf1 tf1 createfile tf2 tf2 @@ -449,59 +427,59 @@ test winFCmd-2.18 {TclpCopyFile: still can't copy onto dst} {95} { set msg "$msg [file writable tf2]" } {1 EACCES 0} -test winFCmd-3.1 {TclpDeleteFile: errno: EACCES} {cdrom} { +test winFCmd-3.1 {TclpDeleteFile: errno: EACCES} {pcOnly cdrom} { list [catch {testfile rm $cdfile $cdrom/dummy~~.fil} msg] $msg } {1 EACCES} -test winFCmd-3.2 {TclpDeleteFile: errno: EISDIR} { +test winFCmd-3.2 {TclpDeleteFile: errno: EISDIR} {pcOnly} { cleanup file mkdir td1 list [catch {testfile rm td1} msg] $msg } {1 EISDIR} -test winFCmd-3.3 {TclpDeleteFile: errno: ENOENT} { +test winFCmd-3.3 {TclpDeleteFile: errno: ENOENT} {pcOnly} { cleanup list [catch {testfile rm tf1} msg] $msg } {1 ENOENT} -test winFCmd-3.4 {TclpDeleteFile: errno: ENOENT} { +test winFCmd-3.4 {TclpDeleteFile: errno: ENOENT} {pcOnly} { cleanup list [catch {testfile rm ""} msg] $msg } {1 ENOENT} -test winFCmd-3.5 {TclpDeleteFile: errno: EACCES} { +test winFCmd-3.5 {TclpDeleteFile: errno: EACCES} {pcOnly} { cleanup set fd [open tf1 w] set msg [list [catch {testfile rm tf1} msg] $msg] close $fd set msg } {1 EACCES} -test winFCmd-3.6 {TclpDeleteFile: errno: EACCES} { +test winFCmd-3.6 {TclpDeleteFile: errno: EACCES} {pcOnly} { cleanup list [catch {testfile rm nul} msg] $msg } {1 EACCES} -test winFCmd-3.7 {TclpDeleteFile: DeleteFile succeeds} { +test winFCmd-3.7 {TclpDeleteFile: DeleteFile succeeds} {pcOnly} { cleanup createfile tf1 testfile rm tf1 file exist tf1 } {0} -test winFCmd-3.8 {TclpDeleteFile: DeleteFile fails} { +test winFCmd-3.8 {TclpDeleteFile: DeleteFile fails} {pcOnly} { cleanup file mkdir td1 list [catch {testfile rm td1} msg] $msg } {1 EISDIR} -test winFCmd-3.9 {TclpDeleteFile: errno == EACCES} { +test winFCmd-3.9 {TclpDeleteFile: errno == EACCES} {pcOnly} { cleanup set fd [open tf1 w] set msg [list [catch {testfile rm tf1} msg] $msg] close $fd set msg } {1 EACCES} -test winFCmd-3.10 {TclpDeleteFile: path is readonly} { +test winFCmd-3.10 {TclpDeleteFile: path is readonly} {pcOnly} { cleanup createfile tf1 testchmod 000 tf1 testfile rm tf1 file exists tf1 } {0} -test winFCmd-3.11 {TclpDeleteFile: still can't remove path} { +test winFCmd-3.11 {TclpDeleteFile: still can't remove path} {pcOnly} { cleanup set fd [open tf1 w] testchmod 000 tf1 @@ -510,82 +488,82 @@ test winFCmd-3.11 {TclpDeleteFile: still can't remove path} { set msg } {1 EACCES} -test winFCmd-4.1 {TclpCreateDirectory: errno: EACCES} {cdrom nt} { +test winFCmd-4.1 {TclpCreateDirectory: errno: EACCES} {nt cdrom} { list [catch {testfile mkdir $cdrom/dummy~~.dir} msg] $msg } {1 EACCES} -test winFCmd-4.2 {TclpCreateDirectory: errno: EACCES} {cdrom 95} { +test winFCmd-4.2 {TclpCreateDirectory: errno: EACCES} {95 cdrom} { list [catch {testfile mkdir $cdrom/dummy~~.dir} msg] $msg } {1 ENOSPC} -test winFCmd-4.3 {TclpCreateDirectory: errno: EEXIST} { +test winFCmd-4.3 {TclpCreateDirectory: errno: EEXIST} {pcOnly} { cleanup file mkdir td1 list [catch {testfile mkdir td1} msg] $msg } {1 EEXIST} -test winFCmd-4.4 {TclpCreateDirectory: errno: ENOENT} { +test winFCmd-4.4 {TclpCreateDirectory: errno: ENOENT} {pcOnly} { cleanup list [catch {testfile mkdir td1/td2} msg] $msg } {1 ENOENT} -test winFCmd-4.5 {TclpCreateDirectory: CreateDirectory succeeds} { +test winFCmd-4.5 {TclpCreateDirectory: CreateDirectory succeeds} {pcOnly} { cleanup testfile mkdir td1 file type td1 } {directory} -test winFCmd-5.1 {TclpCopyDirectory: calls TraverseWinTree} { +test winFCmd-5.1 {TclpCopyDirectory: calls TraverseWinTree} {pcOnly} { cleanup file mkdir td1 testfile cpdir td1 td2 list [file type td1] [file type td2] } {directory directory} -test winFCmd-6.1 {TclpRemoveDirectory: errno: EACCES} { +test winFCmd-6.1 {TclpRemoveDirectory: errno: EACCES} {pcOnly} { cleanup file mkdir td1 testchmod 000 td1 testfile rmdir td1 file exist td1 } {0} -test winFCmd-6.2 {TclpRemoveDirectory: errno: EEXIST} { +test winFCmd-6.2 {TclpRemoveDirectory: errno: EEXIST} {pcOnly} { cleanup file mkdir td1/td2 list [catch {testfile rmdir td1} msg] $msg } {1 {td1 EEXIST}} -test winFCmd-6.3 {TclpRemoveDirectory: errno: EACCES} { +test winFCmd-6.3 {TclpRemoveDirectory: errno: EACCES} {pcOnly} { # can't test this w/o removing everything on your hard disk first! # testfile rmdir / } {} -test winFCmd-6.4 {TclpRemoveDirectory: errno: ENOENT} { +test winFCmd-6.4 {TclpRemoveDirectory: errno: ENOENT} {pcOnly} { cleanup list [catch {testfile rmdir td1} msg] $msg } {1 {td1 ENOENT}} -test winFCmd-6.5 {TclpRemoveDirectory: errno: ENOENT} { +test winFCmd-6.5 {TclpRemoveDirectory: errno: ENOENT} {pcOnly} { cleanup list [catch {testfile rmdir ""} msg] $msg } {1 ENOENT} -test winFCmd-6.6 {TclpRemoveDirectory: errno: ENOTDIR} { +test winFCmd-6.6 {TclpRemoveDirectory: errno: ENOTDIR} {pcOnly} { cleanup createfile tf1 list [catch {testfile rmdir tf1} msg] $msg } {1 {tf1 ENOTDIR}} -test winFCmd-6.7 {TclpRemoveDirectory: RemoveDirectory succeeds} { +test winFCmd-6.7 {TclpRemoveDirectory: RemoveDirectory succeeds} {pcOnly} { cleanup file mkdir td1 testfile rmdir td1 file exists td1 } {0} -test winFCmd-6.8 {TclpRemoveDirectory: RemoveDirectory fails} { +test winFCmd-6.8 {TclpRemoveDirectory: RemoveDirectory fails} {pcOnly} { cleanup createfile tf1 list [catch {testfile rmdir tf1} msg] $msg } {1 {tf1 ENOTDIR}} -test winFCmd-6.9 {TclpRemoveDirectory: errno == EACCES} { +test winFCmd-6.9 {TclpRemoveDirectory: errno == EACCES} {pcOnly} { cleanup file mkdir td1 testchmod 000 td1 testfile rmdir td1 file exists td1 } {0} -test winFCmd-6.10 {TclpRemoveDirectory: attr == -1} {!nt} { +test winFCmd-6.10 {TclpRemoveDirectory: attr == -1} {95} { cleanup list [catch {testfile rmdir nul} msg] $msg } {1 {nul EACCES}} @@ -593,94 +571,95 @@ test winFCmd-6.11 {TclpRemoveDirectory: attr == -1} {nt} { cleanup list [catch {testfile rmdir /} msg] $msg } {1 {\ EACCES}} -test winFCmd-6.12 {TclpRemoveDirectory: errno == EACCES} {!nt} { +test winFCmd-6.12 {TclpRemoveDirectory: errno == EACCES} {95} { cleanup createfile tf1 list [catch {testfile rmdir tf1} msg] $msg } {1 {tf1 ENOTDIR}} -test winFCmd-6.13 {TclpRemoveDirectory: write-protected} { +test winFCmd-6.13 {TclpRemoveDirectory: write-protected} {pcOnly} { cleanup file mkdir td1 testchmod 000 td1 testfile rmdir td1 file exists td1 } {0} -test winFCmd-6.14 {TclpRemoveDirectory: check if empty dir} {!nt} { +test winFCmd-6.14 {TclpRemoveDirectory: check if empty dir} {95} { cleanup file mkdir td1/td2 list [catch {testfile rmdir td1} msg] $msg } {1 {td1 EEXIST}} -test winFCmd-6.15 {TclpRemoveDirectory: !recursive} { +test winFCmd-6.15 {TclpRemoveDirectory: !recursive} {pcOnly} { cleanup file mkdir td1/td2 list [catch {testfile rmdir td1} msg] $msg } {1 {td1 EEXIST}} -test winFCmd-6.16 {TclpRemoveDirectory: recursive, but errno != EEXIST} { +test winFCmd-6.16 {TclpRemoveDirectory: recursive, but errno != EEXIST} {pcOnly} { cleanup createfile tf1 list [catch {testfile rmdir -force tf1} msg] $msg } {1 {tf1 ENOTDIR}} -test winFCmd-6.17 {TclpRemoveDirectory: calls TraverseWinTree} { +test winFCmd-6.17 {TclpRemoveDirectory: calls TraverseWinTree} {pcOnly} { cleanup file mkdir td1/td2 testfile rmdir -force td1 file exists td1 } {0} -test winFCmd-7.1 {TraverseWinTree: targetPtr == NULL} { +test winFCmd-7.1 {TraverseWinTree: targetPtr == NULL} {pcOnly} { cleanup file mkdir td1/td2/td3 testfile rmdir -force td1 file exists td1 } {0} -test winFCmd-7.2 {TraverseWinTree: targetPtr != NULL} { +test winFCmd-7.2 {TraverseWinTree: targetPtr != NULL} {pcOnly} { cleanup file mkdir td1/td2/td3 testfile cpdir td1 td2 list [file exists td1] [file exists td2] } {1 1} -test winFCmd-7.3 {TraverseWinTree: sourceAttr == -1} { +test winFCmd-7.3 {TraverseWinTree: sourceAttr == -1} {pcOnly} { cleanup list [catch {testfile cpdir td1 td2} msg] $msg } {1 {td1 ENOENT}} -test winFCmd-7.4 {TraverseWinTree: source isn't directory} { +test winFCmd-7.4 {TraverseWinTree: source isn't directory} {pcOnly} { cleanup file mkdir td1 createfile td1/tf1 tf1 testfile cpdir td1 td2 contents td2/tf1 } {tf1} -test winFCmd-7.5 {TraverseWinTree: call TraversalCopy: DOTREE_F} { +test winFCmd-7.5 {TraverseWinTree: call TraversalCopy: DOTREE_F} {pcOnly} { cleanup file mkdir td1 createfile td1/tf1 tf1 testfile cpdir td1 td2 contents td2/tf1 } {tf1} -test winFCmd-7.6 {TraverseWinTree: call TraversalDelete: DOTREE_F} { +test winFCmd-7.6 {TraverseWinTree: call TraversalDelete: DOTREE_F} {pcOnly} { cleanup file mkdir td1 createfile td1/tf1 tf1 testfile rmdir -force td1 file exists td1 } {0} -test winFCmd-7.7 {TraverseWinTree: append \ to source if necessary} { +test winFCmd-7.7 {TraverseWinTree: append \ to source if necessary} {pcOnly} { cleanup file mkdir td1 createfile td1/tf1 tf1 testfile cpdir td1 td2 contents td2/tf1 } {tf1} -test winFCmd-7.8 {TraverseWinTree: append \ to source if necessary} {!nt && cdrom} { +test winFCmd-7.8 {TraverseWinTree: append \ to source if necessary} {95 cdrom} { list [catch {testfile rmdir $cdrom/} msg] $msg } "1 {$cdrom\\ EEXIST}" test winFCmd-7.9 {TraverseWinTree: append \ to source if necessary} {nt cdrom} { list [catch {testfile rmdir $cdrom/} msg] $msg } "1 {$cdrom\\ EACCES}" -test winFCmd-7.10 {TraverseWinTree: can't read directory: handle == INVALID} { +test winFCmd-7.10 {TraverseWinTree: can't read directory: handle == INVALID} \ + {pcOnly} { # can't make it happen } {} -test winFCmd-7.11 {TraverseWinTree: call TraversalCopy: DOTREE_PRED} { +test winFCmd-7.11 {TraverseWinTree: call TraversalCopy: DOTREE_PRED} {pcOnly} { cleanup file mkdir td1 testchmod 000 td1 @@ -688,21 +667,21 @@ test winFCmd-7.11 {TraverseWinTree: call TraversalCopy: DOTREE_PRED} { testfile cpdir td1 td2 list [file exists td2] [file writable td2] } {1 0} -test winFCmd-7.12 {TraverseWinTree: call TraversalDelete: DOTREE_PRED} { +test winFCmd-7.12 {TraverseWinTree: call TraversalDelete: DOTREE_PRED} {pcOnly} { cleanup file mkdir td1 createfile td1/tf1 tf1 testfile rmdir -force td1 file exists td1 } {0} -test winFCmd-7.13 {TraverseWinTree: append \ to target if necessary} { +test winFCmd-7.13 {TraverseWinTree: append \ to target if necessary} {pcOnly} { cleanup file mkdir td1 createfile td1/tf1 tf1 testfile cpdir td1 td2 contents td2/tf1 } {tf1} -test winFCmd-7.14 {TraverseWinTree: append \ to target if necessary} {!nt} { +test winFCmd-7.14 {TraverseWinTree: append \ to target if necessary} {95} { cleanup file mkdir td1 list [catch {testfile cpdir td1 /} msg] $msg @@ -712,19 +691,20 @@ test winFCmd-7.15 {TraverseWinTree: append \ to target if necessary} {nt} { file mkdir td1 list [catch {testfile cpdir td1 /} msg] $msg } {1 {\ EACCES}} -test winFCmd-7.16 {TraverseWinTree: recurse on files: no files} { +test winFCmd-7.16 {TraverseWinTree: recurse on files: no files} {pcOnly} { cleanup file mkdir td1 testfile cpdir td1 td2 } {} -test winFCmd-7.17 {TraverseWinTree: recurse on files: one file} { +test winFCmd-7.17 {TraverseWinTree: recurse on files: one file} {pcOnly} { cleanup file mkdir td1 createfile td1/td2 testfile cpdir td1 td2 glob td2/* } {td2/td2} -test winFCmd-7.18 {TraverseWinTree: recurse on files: several files and dir} { +test winFCmd-7.18 {TraverseWinTree: recurse on files: several files and dir} \ + {pcOnly} { cleanup file mkdir td1 createfile td1/tf1 @@ -735,7 +715,7 @@ test winFCmd-7.18 {TraverseWinTree: recurse on files: several files and dir} { testfile cpdir td1 td2 lsort [glob td2/*] } {td2/td2 td2/tf1 td2/tf2 td2/tf3 td2/tf4} -test winFCmd-7.19 {TraverseWinTree: call TraversalCopy: DOTREE_POSTD} { +test winFCmd-7.19 {TraverseWinTree: call TraversalCopy: DOTREE_POSTD} {pcOnly} { cleanup file mkdir td1 testchmod 000 td1 @@ -743,37 +723,38 @@ test winFCmd-7.19 {TraverseWinTree: call TraversalCopy: DOTREE_POSTD} { testfile cpdir td1 td2 list [file exists td2] [file writable td2] } {1 0} -test winFCmd-7.20 {TraverseWinTree: call TraversalDelete: DOTREE_POSTD} { +test winFCmd-7.20 {TraverseWinTree: call TraversalDelete: DOTREE_POSTD} \ + {pcOnly} { cleanup file mkdir td1 createfile td1/tf1 tf1 testfile rmdir -force td1 file exists td1 } {0} -test winFCmd-7.21 {TraverseWinTree: fill errorPtr} { +test winFCmd-7.21 {TraverseWinTree: fill errorPtr} {pcOnly} { cleanup list [catch {testfile cpdir td1 td2} msg] $msg } {1 {td1 ENOENT}} -test winFCmd-8.1 {TraversalCopy: DOTREE_F} { +test winFCmd-8.1 {TraversalCopy: DOTREE_F} {pcOnly} { cleanup file mkdir td1 list [catch {testfile cpdir td1 td1} msg] $msg } {1 {td1 EEXIST}} -test winFCmd-8.2 {TraversalCopy: DOTREE_PRED} { +test winFCmd-8.2 {TraversalCopy: DOTREE_PRED} {pcOnly} { cleanup file mkdir td1/td2 testchmod 000 td1 testfile cpdir td1 td2 list [file writable td1] [file writable td1/td2] } {0 1} -test winFCmd-8.3 {TraversalCopy: DOTREE_POSTD} { +test winFCmd-8.3 {TraversalCopy: DOTREE_POSTD} {pcOnly} { cleanup file mkdir td1 testfile cpdir td1 td2 } {} -test winFCmd-9.1 {TraversalDelete: DOTREE_F} { +test winFCmd-9.1 {TraversalDelete: DOTREE_F} {pcOnly} { cleanup file mkdir td1 createfile td1/tf1 @@ -787,193 +768,211 @@ test winFCmd-9.2 {TraversalDelete: DOTREE_F} {95} { close $fd set msg } {1 {td1\tf1 EACCES}} -test winFCmd-9.3 {TraversalDelete: DOTREE_PRED} { +test winFCmd-9.3 {TraversalDelete: DOTREE_PRED} {pcOnly} { cleanup file mkdir td1/td2 testchmod 000 td1 testfile rmdir -force td1 file exists td1 } {0} -test winFCmd-9.4 {TraversalDelete: DOTREE_POSTD} { +test winFCmd-9.4 {TraversalDelete: DOTREE_POSTD} {pcOnly} { cleanup file mkdir td1/td1/td3/td4/td5 testfile rmdir -force td1 } {} -test winFCmd-10.1 {AttributesPosixError - get} { +test winFCmd-10.1 {AttributesPosixError - get} {pcOnly} { cleanup list [catch {file attributes td1 -archive} msg] $msg -} {1 {cannot get attribute "-archive" for file "td1": no such file or directory}} -test winFCmd-10.2 {AttributesPosixError - set} { +} {1 {could not read "td1": no such file or directory}} +test winFCmd-10.2 {AttributesPosixError - set} {pcOnly} { cleanup list [catch {file attributes td1 -archive 0} msg] $msg -} {1 {cannot set attribute "-archive" for file "td1": no such file or directory}} +} {1 {could not read "td1": no such file or directory}} -test winFCmd-11.1 {GetWinFileAttributes} { +test winFCmd-11.1 {GetWinFileAttributes} {pcOnly} { cleanup close [open td1 w] list [catch {file attributes td1 -archive} msg] $msg [cleanup] } {0 1 {}} -test winFCmd-11.2 {GetWinFileAttributes} { +test winFCmd-11.2 {GetWinFileAttributes} {pcOnly} { cleanup close [open td1 w] list [catch {file attributes td1 -readonly} msg] $msg [cleanup] } {0 0 {}} -test winFCmd-11.3 {GetWinFileAttributes} { +test winFCmd-11.3 {GetWinFileAttributes} {pcOnly} { cleanup close [open td1 w] list [catch {file attributes td1 -hidden} msg] $msg [cleanup] } {0 0 {}} -test winFCmd-11.4 {GetWinFileAttributes} { +test winFCmd-11.4 {GetWinFileAttributes} {pcOnly} { cleanup close [open td1 w] list [catch {file attributes td1 -system} msg] $msg [cleanup] } {0 0 {}} +test winfcmd-11.5 {GetWinFileAttributes} {pcOnly} { + # attr of relative paths that resolve to root was failing + # don't care about answer, just that test runs. + + set old [pwd] + cd c:/ + file attr c: + file attr c:. + file attr . + cd $old +} {} -test winFCmd-12.1 {ConvertFileNameFormat} { +test winFCmd-12.1 {ConvertFileNameFormat} {pcOnly} { cleanup close [open td1 w] list [catch {string tolower [file attributes td1 -longname]} msg] $msg [cleanup] } {0 td1 {}} -test winFCmd-12.2 {ConvertFileNameFormat} { +test winFCmd-12.2 {ConvertFileNameFormat} {pcOnly} { cleanup file mkdir td1 close [open td1/td1 w] list [catch {string tolower [file attributes td1/td1 -longname]} msg] $msg [cleanup] } {0 td1/td1 {}} -test winFCmd-12.3 {ConvertFileNameFormat} { +test winFCmd-12.3 {ConvertFileNameFormat} {pcOnly} { cleanup file mkdir td1 file mkdir td1/td2 close [open td1/td3 w] list [catch {string tolower [file attributes td1/td2/../td3 -longname]} msg] $msg [cleanup] } {0 td1/td2/../td3 {}} -test winFCmd-12.4 {ConvertFileNameFormat} { +test winFCmd-12.4 {ConvertFileNameFormat} {pcOnly} { cleanup close [open td1 w] list [catch {string tolower [file attributes ./td1 -longname]} msg] $msg [cleanup] } {0 ./td1 {}} -test winFCmd-12.5 {ConvertFileNameFormat: absolute path} { +test winFCmd-12.5 {ConvertFileNameFormat: absolute path} {pcOnly} { list [file attributes / -longname] [file attributes \\ -longname] } {/ /} -test winFCmd-12.6 {ConvertFileNameFormat: absolute path with drive} { +test winFCmd-12.6 {ConvertFileNameFormat: absolute path with drive} {pcOnly} { catch {file delete -force -- c:/td1} close [open c:/td1 w] list [catch {string tolower [file attributes c:/td1 -longname]} msg] $msg [file delete -force -- c:/td1] } {0 c:/td1 {}} -test winFCmd-12.7 {ConvertFileNameFormat} {UNCPath} { - catch {file delete -force -- //bisque/icepick/test/td1} - close [open //bisque/icepick/test/td1 w] - list [catch {string tolower [file attributes //bisque/icepick/test/td1 -longname]} msg] $msg [file delete -force -- //bisque/icepick/test/td1] -} {0 //bisque/icepick/test/td1 {}} -test winFCmd-12.8 {ConvertFileNameFormat} {longFileNames} { - cleanup - close [open td1 w] - list [catch {string tolower [file attributes td1 -longname]} msg] $msg [cleanup] -} {0 td1 {}} -test winFCmd-12.9 {ConvertFileNameFormat} {win32s} { +test winFCmd-12.7 {ConvertFileNameFormat} {nonPortable pcOnly} { + string tolower [file attributes //bisque/tcl/ws -longname] +} {//bisque/tcl/ws} +test winFCmd-12.8 {ConvertFileNameFormat} {pcOnly longFileNames} { cleanup close [open td1 w] list [catch {string tolower [file attributes td1 -longname]} msg] $msg [cleanup] } {0 td1 {}} -test winFCmd-12.10 {ConvertFileNameFormat} {longFileNames} { +test winFCmd-12.10 {ConvertFileNameFormat} {longFileNames pcOnly} { cleanup close [open td1td1td1 w] list [catch {file attributes td1td1td1 -shortname}] [cleanup] } {0 {}} -test winFCmd-12.11 {ConvertFileNameFormat} {longFileNames} { +test winFCmd-12.11 {ConvertFileNameFormat} {longFileNames pcOnly} { cleanup close [open td1 w] list [catch {string tolower [file attributes td1 -shortname]} msg] $msg [cleanup] } {0 td1 {}} -test winFCmd-13.1 {GetWinFileLongName} { +test winFCmd-13.1 {GetWinFileLongName} {pcOnly} { cleanup close [open td1 w] list [catch {string tolower [file attributes td1 -longname]} msg] $msg [cleanup] } {0 td1 {}} -test winFCmd-14.1 {GetWinFileShortName} { +test winFCmd-14.1 {GetWinFileShortName} {pcOnly} { cleanup close [open td1 w] list [catch {string tolower [file attributes td1 -shortname]} msg] $msg [cleanup] } {0 td1 {}} -test winFCmd-15.1 {SetWinFileAttributes} { +test winFCmd-15.1 {SetWinFileAttributes} {pcOnly} { cleanup list [catch {file attributes td1 -archive 0} msg] $msg -} {1 {cannot set attribute "-archive" for file "td1": no such file or directory}} -test winFCmd-15.2 {SetWinFileAttributes - archive} { +} {1 {could not read "td1": no such file or directory}} +test winFCmd-15.2 {SetWinFileAttributes - archive} {pcOnly} { cleanup close [open td1 w] list [catch {file attributes td1 -archive 1} msg] $msg [file attributes td1 -archive] [cleanup] } {0 {} 1 {}} -test winFCmd-15.3 {SetWinFileAttributes - archive} { +test winFCmd-15.3 {SetWinFileAttributes - archive} {pcOnly} { cleanup close [open td1 w] list [catch {file attributes td1 -archive 0} msg] $msg [file attributes td1 -archive] [cleanup] } {0 {} 0 {}} -test winFCmd-15.4 {SetWinFileAttributes - hidden} { +test winFCmd-15.4 {SetWinFileAttributes - hidden} {pcOnly} { cleanup close [open td1 w] list [catch {file attributes td1 -hidden 1} msg] $msg [file attributes td1 -hidden] [file attributes td1 -hidden 0] [cleanup] } {0 {} 1 {} {}} -test winFCmd-15.5 {SetWinFileAttributes - hidden} { +test winFCmd-15.5 {SetWinFileAttributes - hidden} {pcOnly} { cleanup close [open td1 w] list [catch {file attributes td1 -hidden 0} msg] $msg [file attributes td1 -hidden] [cleanup] } {0 {} 0 {}} -test winFCmd-15.6 {SetWinFileAttributes - readonly} { +test winFCmd-15.6 {SetWinFileAttributes - readonly} {pcOnly} { cleanup close [open td1 w] list [catch {file attributes td1 -readonly 1} msg] $msg [file attributes td1 -readonly] [cleanup] } {0 {} 1 {}} -test winFCmd-15.7 {SetWinFileAttributes - readonly} { +test winFCmd-15.7 {SetWinFileAttributes - readonly} {pcOnly} { cleanup close [open td1 w] list [catch {file attributes td1 -readonly 0} msg] $msg [file attributes td1 -readonly] [cleanup] } {0 {} 0 {}} -test winFCmd-15.8 {SetWinFileAttributes - system} { +test winFCmd-15.8 {SetWinFileAttributes - system} {pcOnly} { cleanup close [open td1 w] list [catch {file attributes td1 -system 1} msg] $msg [file attributes td1 -system] [cleanup] } {0 {} 1 {}} -test winFCmd-15.9 {SetWinFileAttributes - system} { +test winFCmd-15.9 {SetWinFileAttributes - system} {pcOnly} { cleanup close [open td1 w] list [catch {file attributes td1 -system 0} msg] $msg [file attributes td1 -system] [cleanup] } {0 {} 0 {}} -test winFCmd-15.10 {SetWinFileAttributes - failing} {cdrom} { +test winFCmd-15.10 {SetWinFileAttributes - failing} {pcOnly cdrom} { cleanup catch {file attributes $cdfile -archive 1} } {1} +# This block of code used to occur after the "return" call, so I'm +# commenting it out and assuming that this code is still under construction. +#foreach source {tef ted tnf tnd "" nul com1} { +# foreach chmodsrc {000 755} { +# foreach dest "tfn tfe tdn tdempty tdfull td1/td2 $p $p/td1 {} nul" { +# foreach chmoddst {000 755} { +# puts hi +# cleanup +# file delete -force ted tef +# file mkdir ted +# createfile tef +# createfile tfe +# file mkdir tdempty +# file mkdir tdfull/td1/td2 +# +# catch {testchmod $chmodsrc $source} +# catch {testchmod $chmoddst $dest} +# +# if [catch {file rename $source $dest} msg] { +# puts "file rename $source ($chmodsrc) $dest ($chmoddst)" +# puts $msg +# } +# } +# } +# } +#} + +# cleanup cleanup - +::tcltest::cleanupTests return -foreach source {tef ted tnf tnd "" nul com1} { - foreach chmodsrc {000 755} { - foreach dest "tfn tfe tdn tdempty tdfull td1/td2 $p $p/td1 {} nul" { - foreach chmoddst {000 755} { - puts hi - cleanup - file delete -force ted tef - file mkdir ted - createfile tef - createfile tfe - file mkdir tdempty - file mkdir tdfull/td1/td2 - - catch {testchmod $chmodsrc $source} - catch {testchmod $chmoddst $dest} - - if [catch {file rename $source $dest} msg] { - puts "file rename $source ($chmodsrc) $dest ($chmoddst)" - puts $msg - } - } - } - } -} + + + + + + + + + + |