ad7092b843 2019-09-16 rkeene: #! /usr/bin/env tclsh
ad7092b843 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: package require tcltest
ad7092b843 2019-09-16 rkeene:
10f67b2ced 2019-09-16 rkeene: tcltest::testConstraint tcl87 [string match "8.7.*" [info patchlevel]]
10f67b2ced 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: tcltest::configure -verbose pbse
ad7092b843 2019-09-16 rkeene: tcltest::configure {*}$argv
ad7092b843 2019-09-16 rkeene:
57c553f477 2019-09-18 rkeene: if {![info exists ::env(XVFS_ROOT_MOUNTPOINT)]} {
2139fe19a8 2019-09-18 rkeene: set xvfsRootMountpoint "//xvfs:/"
57c553f477 2019-09-18 rkeene: } else {
57c553f477 2019-09-18 rkeene: set xvfsRootMountpoint $::env(XVFS_ROOT_MOUNTPOINT)
57c553f477 2019-09-18 rkeene: }
57c553f477 2019-09-18 rkeene:
2139fe19a8 2019-09-18 rkeene: set rootDir "${xvfsRootMountpoint}example"
ad7092b843 2019-09-16 rkeene: set rootDirNative [file join [pwd] example]
ad7092b843 2019-09-16 rkeene: #set rootDir $rootDirNative
ad7092b843 2019-09-16 rkeene: set testFile "${rootDir}/foo"
ad7092b843 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: proc glob_verify {args} {
ad7092b843 2019-09-16 rkeene: set rv [glob -nocomplain -directory $::rootDir {*}$args]
ad7092b843 2019-09-16 rkeene: set verify [glob -nocomplain -directory $::rootDirNative {*}$args]
5583d77f1c 2019-09-14 rkeene:
5583d77f1c 2019-09-14 rkeene: if {[llength $rv] != [llength $verify]} {
5583d77f1c 2019-09-14 rkeene: error "VERIFY FAILED: glob ... $args ($rv versus $verify)"
5583d77f1c 2019-09-14 rkeene: }
5583d77f1c 2019-09-14 rkeene:
5583d77f1c 2019-09-14 rkeene: return $rv
e6735bc1dd 2019-09-17 rkeene: }
e6735bc1dd 2019-09-17 rkeene:
e6735bc1dd 2019-09-17 rkeene: proc test_summary {} {
e6735bc1dd 2019-09-17 rkeene: set format "| %7s | %7s | %7s | %7s |"
e6735bc1dd 2019-09-17 rkeene: set emptyRow [format $format "" "" "" ""]
e6735bc1dd 2019-09-17 rkeene: set emptyRowLength [string length $emptyRow]
e6735bc1dd 2019-09-17 rkeene: lappend output "/[string repeat - [expr {$emptyRowLength - 2}]]\\"
e6735bc1dd 2019-09-17 rkeene: lappend output [format $format "Passed" "Failed" "Skipped" "Total"]
e6735bc1dd 2019-09-17 rkeene: lappend output [regsub -all -- " " [regsub -all -- " \\| " $emptyRow " + "] "-"]
e6735bc1dd 2019-09-17 rkeene: lappend output [format $format \
e6735bc1dd 2019-09-17 rkeene: $::tcltest::numTests(Passed) \
e6735bc1dd 2019-09-17 rkeene: $::tcltest::numTests(Failed) \
e6735bc1dd 2019-09-17 rkeene: $::tcltest::numTests(Skipped) \
e6735bc1dd 2019-09-17 rkeene: $::tcltest::numTests(Total) \
e6735bc1dd 2019-09-17 rkeene: ]
e6735bc1dd 2019-09-17 rkeene: lappend output "\\[string repeat - [expr {$emptyRowLength - 2}]]/"
e6735bc1dd 2019-09-17 rkeene:
e6735bc1dd 2019-09-17 rkeene: return [join $output "\n"]
10f67b2ced 2019-09-16 rkeene: }
10f67b2ced 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: tcltest::customMatch boolean [list apply {{expected actual} {
ad7092b843 2019-09-16 rkeene: if {!!$expected == !!$actual} {
ad7092b843 2019-09-16 rkeene: return true
ad7092b843 2019-09-16 rkeene: } else {
ad7092b843 2019-09-16 rkeene: return false
ad7092b843 2019-09-16 rkeene: }
ad7092b843 2019-09-16 rkeene: }}]
ad7092b843 2019-09-16 rkeene:
10f67b2ced 2019-09-16 rkeene: tcltest::test xvfs-seek-basic "Xvfs Seek Test" -setup {
ad7092b843 2019-09-16 rkeene: set fd [open $testFile]
ad7092b843 2019-09-16 rkeene: } -body {
ad7092b843 2019-09-16 rkeene: seek $fd 0 end
ad7092b843 2019-09-16 rkeene: seek $fd -1 current
ad7092b843 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: read $fd 1
ad7092b843 2019-09-16 rkeene: } -cleanup {
ad7092b843 2019-09-16 rkeene: close $fd
ad7092b843 2019-09-16 rkeene: unset fd
ad7092b843 2019-09-16 rkeene: } -result "\n"
10f67b2ced 2019-09-16 rkeene:
10f67b2ced 2019-09-16 rkeene: tcltest::test xvfs-seek-past-eof "Xvfs Seek Past EOF File Test" -setup {
10f67b2ced 2019-09-16 rkeene: set fd [open $testFile]
10f67b2ced 2019-09-16 rkeene: } -body {
10f67b2ced 2019-09-16 rkeene: seek $fd 1 end
10f67b2ced 2019-09-16 rkeene: } -cleanup {
10f67b2ced 2019-09-16 rkeene: close $fd
10f67b2ced 2019-09-16 rkeene: unset fd
10f67b2ced 2019-09-16 rkeene: } -match glob -returnCodes error -result "*: invalid argument"
10f67b2ced 2019-09-16 rkeene:
10f67b2ced 2019-09-16 rkeene: tcltest::test xvfs-seek-past-eof "Xvfs Seek Past EOF File Test" -setup {
10f67b2ced 2019-09-16 rkeene: set fd [open $testFile]
10f67b2ced 2019-09-16 rkeene: } -body {
10f67b2ced 2019-09-16 rkeene: seek $fd -10 current
10f67b2ced 2019-09-16 rkeene: } -cleanup {
10f67b2ced 2019-09-16 rkeene: close $fd
10f67b2ced 2019-09-16 rkeene: unset fd
10f67b2ced 2019-09-16 rkeene: } -match glob -returnCodes error -result "*: invalid argument"
10f67b2ced 2019-09-16 rkeene:
10f67b2ced 2019-09-16 rkeene: tcltest::test xvfs-seek-read-past-eof "Xvfs Seek Then Read Past EOF Test" -setup {
10f67b2ced 2019-09-16 rkeene: set fd [open $testFile]
10f67b2ced 2019-09-16 rkeene: } -body {
10f67b2ced 2019-09-16 rkeene: seek $fd 0 end
10f67b2ced 2019-09-16 rkeene:
10f67b2ced 2019-09-16 rkeene: read $fd 1
10f67b2ced 2019-09-16 rkeene: read $fd 1
10f67b2ced 2019-09-16 rkeene: } -cleanup {
10f67b2ced 2019-09-16 rkeene: close $fd
10f67b2ced 2019-09-16 rkeene: unset fd
10f67b2ced 2019-09-16 rkeene: } -result ""
10f67b2ced 2019-09-16 rkeene:
e786b9e07b 2019-09-16 rkeene: tcltest::test xvfs-basic-open-neg "Xvfs Open Non-Existant File Test" -body {
e786b9e07b 2019-09-16 rkeene: unset -nocomplain fd
e786b9e07b 2019-09-16 rkeene: set fd [open $rootDir/does-not-exist]
e786b9e07b 2019-09-16 rkeene: } -cleanup {
e786b9e07b 2019-09-16 rkeene: if {[info exists fd]} {
e786b9e07b 2019-09-16 rkeene: close $fd
e786b9e07b 2019-09-16 rkeene: unset fd
e786b9e07b 2019-09-16 rkeene: }
e786b9e07b 2019-09-16 rkeene: } -returnCodes error -result "no such file or directory"
e786b9e07b 2019-09-16 rkeene:
e786b9e07b 2019-09-16 rkeene: tcltest::test xvfs-basic-open-write "Xvfs Open For Writing Test" -body {
10f67b2ced 2019-09-16 rkeene: unset -nocomplain fd
10f67b2ced 2019-09-16 rkeene: set fd [open $rootDir/new-file w]
10f67b2ced 2019-09-16 rkeene: } -cleanup {
10f67b2ced 2019-09-16 rkeene: if {[info exists fd]} {
10f67b2ced 2019-09-16 rkeene: close $fd
10f67b2ced 2019-09-16 rkeene: unset fd
10f67b2ced 2019-09-16 rkeene: }
10f67b2ced 2019-09-16 rkeene: catch {
10f67b2ced 2019-09-16 rkeene: file delete $rootDir/new-file
10f67b2ced 2019-09-16 rkeene: }
10f67b2ced 2019-09-16 rkeene: } -match glob -returnCodes error -result "*read*only file*system*"
e786b9e07b 2019-09-16 rkeene:
e786b9e07b 2019-09-16 rkeene: tcltest::test xvfs-basic-open-directory "Xvfs Open Directory Test" -body {
e786b9e07b 2019-09-16 rkeene: unset -nocomplain fd
e786b9e07b 2019-09-16 rkeene: set fd [open $rootDir/lib]
e786b9e07b 2019-09-16 rkeene: set fd
e786b9e07b 2019-09-16 rkeene: } -cleanup {
e786b9e07b 2019-09-16 rkeene: if {[info exists fd]} {
e786b9e07b 2019-09-16 rkeene: close $fd
e786b9e07b 2019-09-16 rkeene: unset fd
e786b9e07b 2019-09-16 rkeene: }
e786b9e07b 2019-09-16 rkeene: } -match glob -returnCodes error -result "*illegal operation on a directory"
ad7092b843 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: tcltest::test xvfs-basic-two-files "Xvfs Multiple Open Files Test" -setup {
ad7092b843 2019-09-16 rkeene: set fd1 [open $testFile]
ad7092b843 2019-09-16 rkeene: set fd2 [open $testFile]
ad7092b843 2019-09-16 rkeene: } -body {
ad7092b843 2019-09-16 rkeene: set data1 [read $fd1]
ad7092b843 2019-09-16 rkeene: close $fd1
ad7092b843 2019-09-16 rkeene: set data2 [read $fd2]
ad7092b843 2019-09-16 rkeene: close $fd2
ad7092b843 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: expr {$data1 eq $data2}
ad7092b843 2019-09-16 rkeene: } -cleanup {
ad7092b843 2019-09-16 rkeene: unset -nocomplain fd1 fd2 data1 data2
ad7092b843 2019-09-16 rkeene: } -match boolean -result true
ad7092b843 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: tcltest::test xvfs-events "Xvfs Fileevent Test" -setup {
ad7092b843 2019-09-16 rkeene: set fd [open $testFile]
ad7092b843 2019-09-16 rkeene: seek $fd 0 end
ad7092b843 2019-09-16 rkeene: set size [tell $fd]
ad7092b843 2019-09-16 rkeene: seek $fd 0 start
ad7092b843 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: set done false
ad7092b843 2019-09-16 rkeene: set calls 0
ad7092b843 2019-09-16 rkeene: set output ""
ad7092b843 2019-09-16 rkeene: } -body {
ad7092b843 2019-09-16 rkeene: fileevent $fd readable [list apply {{fd} {
ad7092b843 2019-09-16 rkeene: set pos [tell $fd]
ad7092b843 2019-09-16 rkeene: set x [read $fd 1]
ad7092b843 2019-09-16 rkeene: if {[string length $x] == 0} {
ad7092b843 2019-09-16 rkeene: set ::done true
ad7092b843 2019-09-16 rkeene: fileevent $fd readable ""
ad7092b843 2019-09-16 rkeene: }
ad7092b843 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: lappend ::output $pos
ad7092b843 2019-09-16 rkeene: incr ::calls
ad7092b843 2019-09-16 rkeene: }} $fd]
ad7092b843 2019-09-16 rkeene: vwait done
ad7092b843 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: list [expr {$calls == ($size + 1)}] [expr {[lsort -integer $output] eq $output}]
ad7092b843 2019-09-16 rkeene: } -cleanup {
ad7092b843 2019-09-16 rkeene: close $fd
10f67b2ced 2019-09-16 rkeene: update
ad7092b843 2019-09-16 rkeene: unset -nocomplain fd size done calls output
ad7092b843 2019-09-16 rkeene: } -result {1 1}
10f67b2ced 2019-09-16 rkeene:
10f67b2ced 2019-09-16 rkeene: tcltest::test xvfs-match-almost-root-neg "Xvfs Match Almost Root" -body {
10f67b2ced 2019-09-16 rkeene: file exists ${rootDir}_DOES_NOT_EXIST
10f67b2ced 2019-09-16 rkeene: } -match boolean -result false
ad7092b843 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: tcltest::test xvfs-glob-basic-any "Xvfs Glob Match Any Test" -body {
ad7092b843 2019-09-16 rkeene: llength [glob_verify *]
ad7092b843 2019-09-16 rkeene: } -result 3
10f67b2ced 2019-09-16 rkeene:
3d002d6892 2019-09-16 rkeene: tcltest::test xvfs-glob-files-any "Xvfs Glob Match Any File Test" -body {
3d002d6892 2019-09-16 rkeene: llength [glob_verify -type f *]
3d002d6892 2019-09-16 rkeene: } -result 2
3d002d6892 2019-09-16 rkeene:
3d002d6892 2019-09-16 rkeene: tcltest::test xvfs-glob-dir-any "Xvfs Glob On a File Test" -body {
3d002d6892 2019-09-16 rkeene: glob -nocomplain -directory $testFile *
3d002d6892 2019-09-16 rkeene: } -returnCodes error -result "not a directory"
3d002d6892 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: tcltest::test xvfs-glob-basic-limited "Xvfs Glob Match Limited Test" -body {
ad7092b843 2019-09-16 rkeene: llength [glob_verify f*]
ad7092b843 2019-09-16 rkeene: } -result 1
ad7092b843 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: tcltest::test xvfs-glob-basic-limited-neg "Xvfs Glob Match Limited Negative Test" -body {
ad7092b843 2019-09-16 rkeene: llength [glob_verify x*]
ad7092b843 2019-09-16 rkeene: } -result 0
ad7092b843 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: tcltest::test xvfs-glob-basic-limited-prefixed "Xvfs Glob Match Limited But With Directory Prefix Test" -body {
ad7092b843 2019-09-16 rkeene: llength [glob_verify ./f*]
ad7092b843 2019-09-16 rkeene: } -result 1
ad7092b843 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: tcltest::test xvfs-glob-basic-limited-and-typed-prefixed "Xvfs Glob Match Limited Path and Type Positive Test" -body {
ad7092b843 2019-09-16 rkeene: llength [glob_verify -type f ./f*]
ad7092b843 2019-09-16 rkeene: } -result 1
ad7092b843 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: tcltest::test xvfs-glob-basic-limited-and-typed-prefixed-neg "Xvfs Glob Match Limited Path and Type Negative Test" -body {
ad7092b843 2019-09-16 rkeene: llength [glob_verify -type d ./f*]
ad7092b843 2019-09-16 rkeene: } -result 0
ad7092b843 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: tcltest::test xvfs-glob-basic-limited-prefixed-other-dir-1 "Xvfs Glob Match Directory Included in Search Test (Count)" -body {
ad7092b843 2019-09-16 rkeene: llength [glob_verify lib/*]
ad7092b843 2019-09-16 rkeene: } -result 1
ad7092b843 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: tcltest::test xvfs-glob-basic-limited-prefixed-other-dir-2 "Xvfs Glob Match Directory Included in Search Test (Value)" -body {
ad7092b843 2019-09-16 rkeene: lindex [glob_verify lib/*] 0
ad7092b843 2019-09-16 rkeene: } -match glob -result "$rootDir/*"
ad7092b843 2019-09-16 rkeene:
3d002d6892 2019-09-16 rkeene: tcltest::test xvfs-glob-no-dir "Xvfs Glob Non-Existant Directory Test" -body {
3d002d6892 2019-09-16 rkeene: glob_verify libx/*
3d002d6892 2019-09-16 rkeene: } -returnCodes error -result "no such file or directory"
3d002d6892 2019-09-16 rkeene:
3d002d6892 2019-09-16 rkeene: tcltest::test xvfs-glob-pipes "Xvfs Glob Pipes Test " -body {
3d002d6892 2019-09-16 rkeene: glob_verify -types {p b c s l} lib/*
3d002d6892 2019-09-16 rkeene: } -result ""
3d002d6892 2019-09-16 rkeene:
3d002d6892 2019-09-16 rkeene: tcltest::test xvfs-glob-writable "Xvfs Glob Writable Test " -body {
3d002d6892 2019-09-16 rkeene: glob -nocomplain -directory $rootDir -types w *
3d002d6892 2019-09-16 rkeene: } -result ""
3d002d6892 2019-09-16 rkeene:
3d002d6892 2019-09-16 rkeene: tcltest::test xvfs-glob-hidden "Xvfs Glob Hidden Test " -body {
3d002d6892 2019-09-16 rkeene: glob -nocomplain -directory $rootDir -types hidden *
3d002d6892 2019-09-16 rkeene: } -result ""
3d002d6892 2019-09-16 rkeene:
3d002d6892 2019-09-16 rkeene: tcltest::test xvfs-glob-executable "Xvfs Glob Executable Test " -body {
3d002d6892 2019-09-16 rkeene: glob -nocomplain -directory $rootDir -types x *
3d002d6892 2019-09-16 rkeene: } -result $rootDir/lib
3d002d6892 2019-09-16 rkeene:
b502b175ea 2020-04-13 rkeene: tcltest::test xvfs-glob-trailing-slash-1 "Xvfs Glob Trailing Slash Test" -body {
b502b175ea 2020-04-13 rkeene: llength [glob -nocomplain -directory $rootDir/ *]
b502b175ea 2020-04-13 rkeene: } -result 3
b502b175ea 2020-04-13 rkeene:
32bd347b13 2020-04-13 rkeene: tcltest::test xvfs-glob-trailing-slash-2 "Xvfs Glob Trailing Slashes Test" -body {
32bd347b13 2020-04-13 rkeene: llength [glob -nocomplain -directory $rootDir//// *]
32bd347b13 2020-04-13 rkeene: } -result 3
32bd347b13 2020-04-13 rkeene:
32bd347b13 2020-04-13 rkeene: tcltest::test xvfs-glob-middle-slash-1 "Xvfs Glob Middle Slash Test" -body {
32bd347b13 2020-04-13 rkeene: llength [glob -nocomplain -directory $rootDir/lib// *]
32bd347b13 2020-04-13 rkeene: } -result 1 -constraints knownBug
32bd347b13 2020-04-13 rkeene:
10f67b2ced 2019-09-16 rkeene: tcltest::test xvfs-access-basic-read "Xvfs acccess Read Basic Test" -body {
10f67b2ced 2019-09-16 rkeene: file readable $testFile
10f67b2ced 2019-09-16 rkeene: } -match boolean -result true
10f67b2ced 2019-09-16 rkeene:
10f67b2ced 2019-09-16 rkeene: tcltest::test xvfs-access-basic-write "Xvfs acccess Write Basic Test" -body {
10f67b2ced 2019-09-16 rkeene: file writable $testFile
10f67b2ced 2019-09-16 rkeene: } -match boolean -result false
10f67b2ced 2019-09-16 rkeene:
10f67b2ced 2019-09-16 rkeene: tcltest::test xvfs-access-basic-neg "Xvfs acccess Basic Negative Test" -body {
10f67b2ced 2019-09-16 rkeene: file executable $testFile
3d002d6892 2019-09-16 rkeene: } -match boolean -result false
3d002d6892 2019-09-16 rkeene:
3d002d6892 2019-09-16 rkeene: tcltest::test xvfs-access-similar-neg "Xvfs acccess Similar Negative Test" -body {
3d002d6892 2019-09-16 rkeene: file executable ${rootDir}_DOES_NOT_EXIST
10f67b2ced 2019-09-16 rkeene: } -match boolean -result false
10f67b2ced 2019-09-16 rkeene:
10f67b2ced 2019-09-16 rkeene: tcltest::test xvfs-exists-basic-neg "Xvfs exists Basic Negative Test" -body {
10f67b2ced 2019-09-16 rkeene: file exists $rootDir/does-not-exist
10f67b2ced 2019-09-16 rkeene: } -match boolean -result false
10f67b2ced 2019-09-16 rkeene:
10f67b2ced 2019-09-16 rkeene: tcltest::test xvfs-stat-basic-file "Xvfs stat Basic File Test" -body {
10f67b2ced 2019-09-16 rkeene: file stat $testFile fileInfo
10f67b2ced 2019-09-16 rkeene: set fileInfo(type)
10f67b2ced 2019-09-16 rkeene: } -cleanup {
10f67b2ced 2019-09-16 rkeene: unset -nocomplain fileInfo
10f67b2ced 2019-09-16 rkeene: } -result file
10f67b2ced 2019-09-16 rkeene:
e786b9e07b 2019-09-16 rkeene: tcltest::test xvfs-stat-basic-file-neg "Xvfs stat Basic File Negative Test" -body {
e786b9e07b 2019-09-16 rkeene: file stat $rootDir/does-not-exist fileInfo
e786b9e07b 2019-09-16 rkeene: } -cleanup {
e786b9e07b 2019-09-16 rkeene: unset -nocomplain fileInfo
e786b9e07b 2019-09-16 rkeene: } -match glob -returnCodes error -result "*no such file or directory"
e786b9e07b 2019-09-16 rkeene:
10f67b2ced 2019-09-16 rkeene: tcltest::test xvfs-stat-basic-dir "Xvfs stat Basic Directory Test" -body {
10f67b2ced 2019-09-16 rkeene: file stat $rootDir/lib fileInfo
10f67b2ced 2019-09-16 rkeene: set fileInfo(type)
10f67b2ced 2019-09-16 rkeene: } -cleanup {
10f67b2ced 2019-09-16 rkeene: unset -nocomplain fileInfo
10f67b2ced 2019-09-16 rkeene: } -result directory
4a6a7916e7 2020-04-13 rkeene:
4a6a7916e7 2020-04-13 rkeene: tcltest::test xvfs-child-interp-basic "Xvfs Child Interp Test" -setup {
4a6a7916e7 2020-04-13 rkeene: set interp [interp create]
4a6a7916e7 2020-04-13 rkeene: } -body {
4a6a7916e7 2020-04-13 rkeene: llength [$interp eval [list glob -nocomplain -directory $rootDir *]]
4a6a7916e7 2020-04-13 rkeene: } -cleanup {
4a6a7916e7 2020-04-13 rkeene: interp delete $interp
4a6a7916e7 2020-04-13 rkeene: unset -nocomplain $interp
4a6a7916e7 2020-04-13 rkeene: } -result 3
4a6a7916e7 2020-04-13 rkeene:
4a6a7916e7 2020-04-13 rkeene: tcltest::test xvfs-thread-interp-basic "Xvfs Thread Interp Test" -setup {
4a6a7916e7 2020-04-13 rkeene: package require Thread
4a6a7916e7 2020-04-13 rkeene: set thread [thread::create -joinable]
4a6a7916e7 2020-04-13 rkeene: } -body {
4a6a7916e7 2020-04-13 rkeene: llength [thread::send $thread [list glob -nocomplain -directory $rootDir *]]
4a6a7916e7 2020-04-13 rkeene: } -cleanup {
4a6a7916e7 2020-04-13 rkeene: thread::release -wait $thread
4a6a7916e7 2020-04-13 rkeene: thread::join $thread
4a6a7916e7 2020-04-13 rkeene: unset -nocomplain $thread
4a6a7916e7 2020-04-13 rkeene: } -result 3
57c553f477 2019-09-18 rkeene:
ad7092b843 2019-09-16 rkeene: # Broken in Tcl 8.6 and earlier
ad7092b843 2019-09-16 rkeene: tcltest::test xvfs-glob-advanced-dir-with-pattern "Xvfs Glob Match Pattern and Directory Together" -body {
57c553f477 2019-09-18 rkeene: llength [glob ${rootDir}/*]
ad7092b843 2019-09-16 rkeene: } -constraints tcl87 -result 3
ad7092b843 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: tcltest::test xvfs-glob-file-dirname "Xvfs Relies on file dirname" -body {
ad7092b843 2019-09-16 rkeene: lindex [glob -directory [file dirname $testFile] *] 0
ad7092b843 2019-09-16 rkeene: } -constraints tcl87 -match glob -result "$rootDir/*"
ad7092b843 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: tcltest::test xvfs-cwd-1 "Xvfs Can Be cwd" -setup {
ad7092b843 2019-09-16 rkeene: set startDir [pwd]
ad7092b843 2019-09-16 rkeene: } -body {
ad7092b843 2019-09-16 rkeene: cd $rootDir
ad7092b843 2019-09-16 rkeene: pwd
ad7092b843 2019-09-16 rkeene: } -cleanup {
ad7092b843 2019-09-16 rkeene: cd $startDir
ad7092b843 2019-09-16 rkeene: unset startDir
e4bde431db 2019-09-16 rkeene: } -constraints tcl87 -result $rootDir
ad7092b843 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: tcltest::test xvfs-cwd-2 "Xvfs Can Be cwd" -setup {
ad7092b843 2019-09-16 rkeene: set startDir [pwd]
ad7092b843 2019-09-16 rkeene: } -body {
ad7092b843 2019-09-16 rkeene: cd $rootDir
ad7092b843 2019-09-16 rkeene: cd lib
ad7092b843 2019-09-16 rkeene: lindex [glob *] 0
ad7092b843 2019-09-16 rkeene: } -cleanup {
ad7092b843 2019-09-16 rkeene: cd $startDir
ad7092b843 2019-09-16 rkeene: unset startDir
e4bde431db 2019-09-16 rkeene: } -constraints tcl87 -result "hello"
ad7092b843 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: # Currently broken
ad7092b843 2019-09-16 rkeene: tcltest::test xvfs-package "Xvfs Can Be Package Directory" -setup {
ad7092b843 2019-09-16 rkeene: set startAutoPath $auto_path
ad7092b843 2019-09-16 rkeene: lappend auto_path ${rootDir}/lib
ad7092b843 2019-09-16 rkeene: } -body {
ad7092b843 2019-09-16 rkeene: package require hello
ad7092b843 2019-09-16 rkeene: set auto_path
ad7092b843 2019-09-16 rkeene: } -cleanup {
ad7092b843 2019-09-16 rkeene: set auto_path $startAutoPath
ad7092b843 2019-09-16 rkeene: unset startAutoPath
ad7092b843 2019-09-16 rkeene: } -constraints knownBug -result ""
ad7092b843 2019-09-16 rkeene:
ad7092b843 2019-09-16 rkeene: # Output results
ad7092b843 2019-09-16 rkeene: if {$::tcltest::numTests(Failed) != 0} {
e6735bc1dd 2019-09-17 rkeene: puts [test_summary]
10f67b2ced 2019-09-16 rkeene: if {[info exists ::env(XVFS_TEST_EXIT_ON_FAILURE)]} {
10f67b2ced 2019-09-16 rkeene: exit $::env(XVFS_TEST_EXIT_ON_FAILURE)
10f67b2ced 2019-09-16 rkeene: }
ad7092b843 2019-09-16 rkeene: exit 1
ad7092b843 2019-09-16 rkeene: }
ad7092b843 2019-09-16 rkeene:
e6735bc1dd 2019-09-17 rkeene: puts [test_summary]
5583d77f1c 2019-09-14 rkeene: puts "ALL TESTS PASSED"
ad7092b843 2019-09-16 rkeene:
10f67b2ced 2019-09-16 rkeene: if {[info exists ::env(XVFS_TEST_EXIT_ON_SUCCESS)]} {
10f67b2ced 2019-09-16 rkeene: exit $::env(XVFS_TEST_EXIT_ON_SUCCESS)
10f67b2ced 2019-09-16 rkeene: }
ad7092b843 2019-09-16 rkeene: exit 0