summaryrefslogtreecommitdiffstats
path: root/tests/fCmd.test
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2009-11-11 23:46:08 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2009-11-11 23:46:08 (GMT)
commitd62d7a297748587b7bab1a0d7aca0294c0e5eb6f (patch)
treecad215a0428385ccd12f59b1d982691cfbaefa25 /tests/fCmd.test
parent947926bbfb3e90bc9a7fe4fc72f72f97abd12438 (diff)
downloadtcl-d62d7a297748587b7bab1a0d7aca0294c0e5eb6f.zip
tcl-d62d7a297748587b7bab1a0d7aca0294c0e5eb6f.tar.gz
tcl-d62d7a297748587b7bab1a0d7aca0294c0e5eb6f.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 a1f214d..879bb24 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.60.2.1 2008/08/14 00:08:34 das Exp $
+# RCS: @(#) $Id: fCmd.test,v 1.60.2.2 2009/11/11 23:46:09 patthoyts Exp $
#
if {[lsearch [namespace children] ::tcltest] == -1} {
@@ -20,6 +20,9 @@ if {[lsearch [namespace children] ::tcltest] == -1} {
testConstraint testsetplatform [llength [info commands testsetplatform]]
testConstraint testchmod [llength [info commands testchmod]]
+testConstraint winVista 0
+testConstraint win2000orXP 0
+testConstraint winOlderThan2000 0
# Don't know how to determine this constraint correctly
testConstraint notNetworkFilesystem 0
testConstraint 95or98 [expr {[testConstraint 95] || [testConstraint 98]}]
@@ -36,6 +39,20 @@ if {[testConstraint 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
+ }
+}
+
testConstraint darwin9 [expr {[testConstraint unix] &&
$tcl_platform(os) eq "Darwin" &&
int([string range $tcl_platform(osVersion) 0 \
@@ -738,7 +755,7 @@ test fCmd-9.3 {file rename: comprehensive: file to new name} -setup {
} -result {{tf3 tf4} 1 0}
test fCmd-9.4 {file rename: comprehensive: dir to new name} -setup {
cleanup
-} -constraints {unixOrPc notRoot testchmod notDarwin9} -body {
+} -constraints {unixOrPc notRoot testchmod notDarwin9 win2000orXP} -body {
file mkdir td1 td2
testchmod 555 td2
file rename td1 td3
@@ -758,7 +775,7 @@ test fCmd-9.5 {file rename: comprehensive: file to self} {notRoot testchmod} {
} {tf1 tf2 1 0}
test fCmd-9.6 {file rename: comprehensive: dir to self} -setup {
cleanup
-} -constraints {notRoot unixOrPc testchmod} -body {
+} -constraints {notRoot unixOrPc testchmod win2000orXP} -body {
file mkdir td1
file mkdir td2
testchmod 555 td2
@@ -835,12 +852,12 @@ test fCmd-9.9 {file rename: comprehensive: dir to non-empty dir} -setup {
file mkdir tds2
file mkdir [file join tdd1 tds1 xxx]
file mkdir [file join tdd2 tds2 xxx]
- if {![testConstraint unix]} {
+ if {!([testConstraint unix] || [testConstraint winVista])} {
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 {[testConstraint unix]} {
+ if {[testConstraint unix] || [testConstraint winVista]} {
set w2 0
} else {
set w2 [file writable tds2]
@@ -864,12 +881,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 {![testConstraint unix]} {
+ if {!([testConstraint unix] || [testConstraint winVista])} {
testchmod 555 td2
}
file rename td1 [file join td3 td3]
file rename td2 [file join td3 td4]
- if {[testConstraint unix]} {
+ if {[testConstraint unix] || [testConstraint winVista]} {
set w4 0
} else {
set w4 [file writable [file join td3 td4]]