diff options
Diffstat (limited to 'tests/winPipe.test')
-rw-r--r-- | tests/winPipe.test | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/tests/winPipe.test b/tests/winPipe.test index 52eba11..28cec62 100644 --- a/tests/winPipe.test +++ b/tests/winPipe.test @@ -12,12 +12,12 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: winPipe.test,v 1.18 2002/07/04 20:26:08 andreas_kupries Exp $ +# RCS: @(#) $Id: winPipe.test,v 1.19 2002/07/10 11:56:45 dgp Exp $ -if {[lsearch [namespace children] ::tcltest] == -1} { - package require tcltest - namespace import -force ::tcltest::* -} +package require tcltest +namespace import -force ::tcltest::* + +testConstraint exec [llength [info commands exec]] set bindir [file join [pwd] [file dirname [info nameofexecutable]]] set cat32 [file join $bindir cat32.exe] @@ -64,90 +64,90 @@ set path(more) [makeFile { set path(stdout) [makeFile {} stdout] set path(stderr) [makeFile {} stderr] -test winpipe-1.1 {32 bit comprehensive tests: from little file} {pcOnly stdio cat32} { +test winpipe-1.1 {32 bit comprehensive tests: from little file} {pcOnly exec cat32} { exec $cat32 < $path(little) > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } {little stderr32} -test winpipe-1.2 {32 bit comprehensive tests: from big file} {pcOnly stdio cat32} { +test winpipe-1.2 {32 bit comprehensive tests: from big file} {pcOnly exec cat32} { exec $cat32 < $path(big) > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } "{$big} stderr32" -test winpipe-1.3 {32 bit comprehensive tests: a little from pipe} {nt stdio cat32} { - exec $::tcltest::tcltest more < little | $cat32 > $path(stdout) 2> $path(stderr) +test winpipe-1.3 {32 bit comprehensive tests: a little from pipe} {nt exec cat32} { + exec [interpreter] more < little | $cat32 > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } {little stderr32} -test winpipe-1.4 {32 bit comprehensive tests: a lot from pipe} {nt stdio cat32} { - exec $::tcltest::tcltest more < big | $cat32 > $path(stdout) 2> $path(stderr) +test winpipe-1.4 {32 bit comprehensive tests: a lot from pipe} {nt exec cat32} { + exec [interpreter] more < big | $cat32 > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } "{$big} stderr32" -test winpipe-1.5 {32 bit comprehensive tests: a lot from pipe} {95 stdio cat32} { +test winpipe-1.5 {32 bit comprehensive tests: a lot from pipe} {95 exec cat32} { exec command /c type big |& $cat32 > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } "{$big} stderr32" test winpipe-1.6 {32 bit comprehensive tests: from console} \ - {pcOnly stdio cat32 AllocConsole} { + {pcOnly cat32 AllocConsole} { # would block waiting for human input } {} -test winpipe-1.7 {32 bit comprehensive tests: from NUL} {pcOnly stdio cat32} { +test winpipe-1.7 {32 bit comprehensive tests: from NUL} {pcOnly exec cat32} { exec $cat32 < nul > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } {{} stderr32} -test winpipe-1.8 {32 bit comprehensive tests: from socket} {pcOnly stdio cat32} { +test winpipe-1.8 {32 bit comprehensive tests: from socket} {pcOnly cat32} { # doesn't work } {} test winpipe-1.9 {32 bit comprehensive tests: from nowhere} \ - {pcOnly stdio cat32 .console} { + {pcOnly exec cat32 .console} { exec $cat32 > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } {{} stderr32} test winpipe-1.10 {32 bit comprehensive tests: from file handle} \ - {pcOnly stdio cat32} { + {pcOnly exec cat32} { set f [open $path(little) r] exec $cat32 <@$f > $path(stdout) 2> $path(stderr) close $f list [contents $path(stdout)] [contents $path(stderr)] } {little stderr32} test winpipe-1.11 {32 bit comprehensive tests: read from application} \ - {pcOnly stdio cat32} { + {pcOnly exec cat32} { set f [open "|[list $cat32] < $path(little)" r] gets $f line catch {close $f} msg list $line $msg } {little stderr32} test winpipe-1.12 {32 bit comprehensive tests: a little to file} \ - {pcOnly stdio cat32} { + {pcOnly exec cat32} { exec $cat32 < $path(little) > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } {little stderr32} test winpipe-1.13 {32 bit comprehensive tests: a lot to file} \ - {pcOnly stdio cat32} { + {pcOnly exec cat32} { exec $cat32 < $path(big) > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } "{$big} stderr32" test winpipe-1.14 {32 bit comprehensive tests: a little to pipe} \ - {pcOnly stdio cat32} { - exec $cat32 < $path(little) | $::tcltest::tcltest $path(more) > $path(stdout) 2> $path(stderr) + {pcOnly exec stdio cat32} { + exec $cat32 < $path(little) | [interpreter] $path(more) > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } {little stderr32} test winpipe-1.15 {32 bit comprehensive tests: a lot to pipe} \ - {pcOnly stdio cat32} { - exec $cat32 < $path(big) | $::tcltest::tcltest $path(more) > $path(stdout) 2> $path(stderr) + {pcOnly exec stdio cat32} { + exec $cat32 < $path(big) | [interpreter] $path(more) > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } "{$big} stderr32" -test winpipe-1.16 {32 bit comprehensive tests: to console} {pcOnly stdio cat32} { +test winpipe-1.16 {32 bit comprehensive tests: to console} {pcOnly exec cat32} { catch {exec $cat32 << "You should see this\n" >@stdout} msg set msg } stderr32 -test winpipe-1.17 {32 bit comprehensive tests: to NUL} {pcOnly stdio cat32} { +test winpipe-1.17 {32 bit comprehensive tests: to NUL} {pcOnly exec cat32} { # some apps hang when sending a large amount to NUL. $cat32 isn't one. catch {exec $cat32 < $path(big) > nul} msg set msg } stderr32 test winpipe-1.18 {32 bit comprehensive tests: to nowhere} \ - {pcOnly stdio cat32 .console} { + {pcOnly exec cat32 .console} { exec $cat32 < $path(big) >&@stdout } {} -test winpipe-1.19 {32 bit comprehensive tests: to file handle} {pcOnly stdio cat32} { +test winpipe-1.19 {32 bit comprehensive tests: to file handle} {pcOnly exec cat32} { set f1 [open $path(stdout) w] set f2 [open $path(stderr) w] exec $cat32 < $path(little) >@$f1 2>@$f2 @@ -156,14 +156,14 @@ test winpipe-1.19 {32 bit comprehensive tests: to file handle} {pcOnly stdio cat list [contents $path(stdout)] [contents $path(stderr)] } {little stderr32} test winpipe-1.20 {32 bit comprehensive tests: write to application} \ - {pcOnly stdio cat32} { + {pcOnly exec cat32} { set f [open |[list $cat32 >$path(stdout)] w] puts -nonewline $f "foo" catch {close $f} msg list [contents $path(stdout)] $msg } {foo stderr32} test winpipe-1.21 {32 bit comprehensive tests: read/write application} \ - {pcOnly stdio cat32} { + {pcOnly exec cat32} { set f [open "|[list $cat32]" r+] puts $f $big puts $f \032 @@ -172,13 +172,13 @@ test winpipe-1.21 {32 bit comprehensive tests: read/write application} \ catch {close $f} set r } "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" -test winpipe-1.22 {Checking command.com for Win95/98 hanging} {95 stdio} { +test winpipe-1.22 {Checking command.com for Win95/98 hanging} {95 exec} { exec command.com /c dir /b set result 1 } 1 file delete more -test winpipe-4.1 {Tcl_WaitPid} {nt stdio cat32} { +test winpipe-4.1 {Tcl_WaitPid} {nt exec cat32} { proc readResults {f} { global x result if { [eof $f] } { @@ -208,10 +208,10 @@ catch {set env_temp $env(TEMP)} set env(TMP) c:/ set env(TEMP) c:/ -test winpipe-5.1 {TclpCreateTempFile: cleanup temp files} {pcOnly stdio} { +test winpipe-5.1 {TclpCreateTempFile: cleanup temp files} {pcOnly exec} { set x {} set existing [glob -nocomplain c:/tcl*.tmp] - exec $::tcltest::tcltest < nothing + exec [interpreter] < nothing foreach p [glob -nocomplain c:/tcl*.tmp] { if {[lsearch $existing $p] == -1} { lappend x $p @@ -219,38 +219,38 @@ test winpipe-5.1 {TclpCreateTempFile: cleanup temp files} {pcOnly stdio} { } set x } {} -test winpipe-5.2 {TclpCreateTempFile: TMP and TEMP not defined} {pcOnly stdio} { +test winpipe-5.2 {TclpCreateTempFile: TMP and TEMP not defined} {pcOnly exec} { set tmp $env(TMP) set temp $env(TEMP) unset env(TMP) unset env(TEMP) - exec $::tcltest::tcltest < nothing + exec [interpreter] < nothing set env(TMP) $tmp set env(TEMP) $temp set x {} } {} test winpipe-5.3 {TclpCreateTempFile: TMP specifies non-existent directory} \ - {pcOnly stdio} { + {pcOnly exec } { set tmp $env(TMP) set env(TMP) snarky - exec $::tcltest::tcltest < nothing + exec [interpreter] < nothing set env(TMP) $tmp set x {} } {} test winpipe-5.4 {TclpCreateTempFile: TEMP specifies non-existent directory} \ - {pcOnly stdio} { + {pcOnly exec} { set tmp $env(TMP) set temp $env(TEMP) unset env(TMP) set env(TEMP) snarky - exec $::tcltest::tcltest < nothing + exec [interpreter] < nothing set env(TMP) $tmp set env(TEMP) $temp set x {} } {} test winpipe-6.1 {PipeSetupProc & PipeCheckProc: read threads} \ - {pcOnly stdio cat32} { + {pcOnly exec cat32} { set f [open "|[list $cat32]" r+] fconfigure $f -blocking 0 fileevent $f writable { set x writable } @@ -270,7 +270,7 @@ test winpipe-6.1 {PipeSetupProc & PipeCheckProc: read threads} \ } {writable timeout readable {foobar } timeout 1 stderr32} test winpipe-6.2 {PipeSetupProc & PipeCheckProc: write threads} \ - {pcOnly stdio cat32} { + {pcOnly exec cat32} { set f [open "|[list $cat32]" r+] fconfigure $f -blocking 0 fileevent $f writable { set x writable } @@ -287,11 +287,11 @@ set path(echoArgs.tcl) [makeFile { puts "[list $argv0 $argv]" } echoArgs.tcl] -test winpipe-7.1 {BuildCommandLine: null arguments} {pcOnly stdio} { - exec $::tcltest::tcltest $path(echoArgs.tcl) foo "" bar +test winpipe-7.1 {BuildCommandLine: null arguments} {pcOnly exec} { + exec [interprter] $path(echoArgs.tcl) foo "" bar } [list $path(echoArgs.tcl) {foo {} bar}] -test winpipe-7.2 {BuildCommandLine: null arguments} {pcOnly stdio} { - exec $::tcltest::tcltest $path(echoArgs.tcl) foo \" bar +test winpipe-7.2 {BuildCommandLine: null arguments} {pcOnly exec} { + exec [interprter] $path(echoArgs.tcl) foo \" bar } [list $path(echoArgs.tcl) {foo {"} bar}] # restore old values for env(TMP) and env(TEMP) |