+2002-04-25 Vince Darley <vincentdarley@sourceforge.net>
+ * tests/*: revamp of tests to be more robust, and to be
+ able to run from inside a mounted virtual filesystem.
+
2002-04-09 Jean-Claude Wippler <jcw@equi4.com>
* configure: generated and added to project
package require vfs
-proc filelistrelative {filelist} {
- set dir [file normalize [file dirname [file dirname [info script]]]]
+proc filelistrelative {filelist {remove ""}} {
+ if {[llength $remove]} {
+ set newlist {}
+ foreach f $filelist {
+ if {[lsearch -exact $remove $f] == -1} {
+ lappend newlist $f
+ }
+ }
+ set filelist $newlist
+ }
+ set dir [file normalize [file dirname [info script]]]
set len [string length $dir]
incr len
set res {}
# Test 2.x sub-interps
-vfs::filesystem mount foo bar
-
test vfs-2.1 {mount unmount in sub interp} {
catch {interp delete a}
catch {unset res}
set res {}
+ set remove [vfs::filesystem info]
+ vfs::filesystem mount foo bar
interp create a
a eval {package require vfs}
a eval {vfs::filesystem mount foo2 bar2}
a eval {vfs::filesystem unmount foo2}
interp delete a
eval lappend res [vfs::filesystem info]
- filelistrelative $res
+ vfs::filesystem unmount foo
+ filelistrelative $res $remove
} {foo2 foo foo}
test vfs-2.2 {mount, delete sub interp} {
catch {interp delete a}
catch {unset res}
+ set remove [vfs::filesystem info]
+ vfs::filesystem mount foo bar
interp create a
a eval {package require vfs}
a eval {vfs::filesystem mount foo2 bar2}
eval lappend res [vfs::filesystem info]
interp delete a
eval lappend res [vfs::filesystem info]
- filelistrelative $res
+ vfs::filesystem unmount foo
+ filelistrelative $res $remove
} {foo2 foo foo}
-vfs::filesystem unmount foo
-
# cleanup
::tcltest::cleanupTests
return
set res
} {New volume 'ftp://' mounted}
-test vfsUrl-2.1 {auto-mount ftp and copy file} {
+test vfsUrl-2.1 {auto-mount ftp and copy file} {vfsWritable} {
file delete -force README.tclversions
file copy ftp://ftp.scriptics.com/pub/tcl/README.tclversions $vfsTestDir
set to [file join $vfsTestDir README.tclversions]