summaryrefslogtreecommitdiffstats
path: root/tests/fCmd.test
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2009-11-10 22:32:38 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2009-11-10 22:32:38 (GMT)
commit36ee8f97a7bc35cc7b82bb990738895b85fedff2 (patch)
treeacd982f45df30f67b0cf223361d0c390177c3f4a /tests/fCmd.test
parent20eb71254d8455f4cb7ba4a13af8955fb47178e2 (diff)
downloadtcl-36ee8f97a7bc35cc7b82bb990738895b85fedff2.zip
tcl-36ee8f97a7bc35cc7b82bb990738895b85fedff2.tar.gz
tcl-36ee8f97a7bc35cc7b82bb990738895b85fedff2.tar.bz2
Fixed a number of test issues for Vista and Win7.
These test failures are due to the more restrictive permissions on the newer versions of Windows.
Diffstat (limited to 'tests/fCmd.test')
-rw-r--r--tests/fCmd.test31
1 files changed, 24 insertions, 7 deletions
diff --git a/tests/fCmd.test b/tests/fCmd.test
index 1491c76..170a155 100644
--- a/tests/fCmd.test
+++ b/tests/fCmd.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: fCmd.test,v 1.26.2.9 2007/05/17 14:18:42 dgp Exp $
+# RCS: @(#) $Id: fCmd.test,v 1.26.2.10 2009/11/10 22:32:39 patthoyts Exp $
#
if {[lsearch [namespace children] ::tcltest] == -1} {
@@ -23,6 +23,9 @@ tcltest::testConstraint testchmod [string equal testchmod [info commands testchm
tcltest::testConstraint notNetworkFilesystem 0
testConstraint 95or98 [expr {[testConstraint 95] || [testConstraint 98]}]
testConstraint 2000orNewer [expr {![testConstraint 95or98]}]
+testConstraint winVista 0
+testConstraint win2000orXP 0
+testConstraint winOlderThan2000 0
# Several tests require need to match results against the unix username
set user {}
@@ -36,6 +39,20 @@ if {$tcl_platform(platform) == "unix"} {
}
}
+# Also used in winFCmd...
+if {[testConstraint winOnly]} {
+ set major [string index $tcl_platform(osVersion) 0]
+ if {[testConstraint nt] && $major > 4} {
+ if {$major > 5} {
+ testConstraint winVista 1
+ } elseif {$major == 5} {
+ testConstraint win2000orXP 1
+ }
+ } else {
+ testConstraint winOlderThan2000 1
+ }
+}
+
proc createfile {file {string a}} {
set f [open $file w]
puts -nonewline $f $string
@@ -706,7 +723,7 @@ test fCmd-9.3 {file rename: comprehensive: file to new name} {notRoot testchmod}
file rename tf2 tf4
list [lsort [glob tf*]] [file writable tf3] [file writable tf4]
} {{tf3 tf4} 1 0}
-test fCmd-9.4 {file rename: comprehensive: dir to new name} {unixOrPc notRoot testchmod} {
+test fCmd-9.4 {file rename: comprehensive: dir to new name} {unixOrPc notRoot testchmod win2000orXP} {
cleanup
file mkdir td1 td2
testchmod 555 td2
@@ -723,7 +740,7 @@ test fCmd-9.5 {file rename: comprehensive: file to self} {notRoot testchmod} {
file rename -force tf2 tf2
list [contents tf1] [contents tf2] [file writable tf1] [file writable tf2]
} {tf1 tf2 1 0}
-test fCmd-9.6 {file rename: comprehensive: dir to self} {notRoot unixOrPc testchmod} {
+test fCmd-9.6 {file rename: comprehensive: dir to self} {notRoot unixOrPc testchmod win2000orXP} {
cleanup
file mkdir td1
file mkdir td2
@@ -799,12 +816,12 @@ test fCmd-9.9 {file rename: comprehensive: dir to non-empty dir} {notRoot testch
file mkdir tds2
file mkdir [file join tdd1 tds1 xxx]
file mkdir [file join tdd2 tds2 xxx]
- if {$tcl_platform(platform) != "unix" && $tcl_platform(platform) != "macintosh"} {
+ if {!([testConstraint unix] || [testConstraint winVista]) && $tcl_platform(platform) != "macintosh"} {
testchmod 555 tds2
}
set a1 [list [catch {file rename -force tds1 tdd1} msg] $msg]
set a2 [list [catch {file rename -force tds2 tdd2} msg] $msg]
- if {$tcl_platform(platform) != "unix" && $tcl_platform(platform) != "macintosh"} {
+ if {!([testConstraint unix] || [testConstraint winVista]) && $tcl_platform(platform) != "macintosh"} {
set w2 [file writable tds2]
} else {
set w2 0
@@ -827,12 +844,12 @@ test fCmd-9.11 {file rename: comprehensive: dir to new name and dir} {notRoot te
file mkdir td1
file mkdir td2
file mkdir td3
- if {$tcl_platform(platform) != "unix" && $tcl_platform(platform) != "macintosh"} {
+ if {!([testConstraint unix] || [testConstraint winVista]) && $tcl_platform(platform) != "macintosh"} {
testchmod 555 td2
}
file rename td1 [file join td3 td3]
file rename td2 [file join td3 td4]
- if {$tcl_platform(platform) != "unix" && $tcl_platform(platform) != "macintosh"} {
+ if {!([testConstraint unix] || [testConstraint winVista]) && $tcl_platform(platform) != "macintosh"} {
set w4 [file writable [file join td3 td4]]
} else {
set w4 0