Index: tests/winPipe.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/winPipe.test,v
retrieving revision 1.16
diff -u -r1.16 winPipe.test
--- tests/winPipe.test	24 May 2002 22:43:31 -0000	1.16
+++ tests/winPipe.test	4 Jul 2002 19:39:01 -0000
@@ -38,11 +38,13 @@
 append big $big
 append big $big
 
-set f [open "little" w] 
+set path(little) [makeFile {} little]
+set f [open $path(little) w] 
 puts -nonewline $f "little"
 close $f
 
-set f [open "big" w]
+set path(big) [makeFile {} big]
+set f [open $path(big) w]
 puts -nonewline $f $big
 close $f
 
@@ -53,83 +55,84 @@
     set r
 }
 
-set f [open more w]
-puts $f {
+set path(more) [makeFile {
     while {[eof stdin] == 0} {
 	puts -nonewline [read stdin]
     }
-}
-close $f
+} more]
+
+set path(stdout) [makeFile {} stdout]
+set path(stderr) [makeFile {} stderr]
 
 test winpipe-1.1 {32 bit comprehensive tests: from little file} {pcOnly stdio cat32} {
-    exec $cat32 < little > stdout 2> stderr
-    list [contents stdout] [contents stderr]
+    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} {
-    exec $cat32 < big > stdout 2> stderr
-    list [contents stdout] [contents stderr]
+    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 > stdout 2> stderr
-    list [contents stdout] [contents stderr]
+    exec $::tcltest::tcltest 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 > stdout 2> stderr
-    list [contents stdout] [contents stderr]
+    exec $::tcltest::tcltest 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} {
-    exec command /c type big |& $cat32 > stdout 2> stderr
-    list [contents stdout] [contents stderr]
+    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} {
     # would block waiting for human input
 } {}
 test winpipe-1.7 {32 bit comprehensive tests: from NUL} {pcOnly stdio cat32} {
-    exec $cat32 < nul > stdout 2> stderr
-    list [contents stdout] [contents stderr]
+    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} {
     # doesn't work
 } {}
 test winpipe-1.9 {32 bit comprehensive tests: from nowhere} \
 	{pcOnly stdio cat32 .console} {
-    exec $cat32 > stdout 2> stderr
-    list [contents stdout] [contents stderr]
+    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} {
-    set f [open "little" r]
-    exec $cat32 <@$f > stdout 2> stderr
+    set f [open $path(little) r]
+    exec $cat32 <@$f > $path(stdout) 2> $path(stderr)
     close $f
-    list [contents stdout] [contents stderr]
+    list [contents $path(stdout)] [contents $path(stderr)]
 } {little stderr32}
 test winpipe-1.11 {32 bit comprehensive tests: read from application} \
 	{pcOnly stdio cat32} {
-    set f [open "|[list $cat32] < little" r]
+    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} {
-    exec $cat32 < little > stdout 2> stderr
-    list [contents stdout] [contents stderr]
+    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} {
-    exec $cat32 < big > stdout 2> stderr
-    list [contents stdout] [contents stderr]
+    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 < little | $::tcltest::tcltest more > stdout 2> stderr
-    list [contents stdout] [contents stderr]
+    exec $cat32 < $path(little) | $::tcltest::tcltest $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 < big | $::tcltest::tcltest more > stdout 2> stderr
-    list [contents stdout] [contents stderr]
+    exec $cat32 < $path(big) | $::tcltest::tcltest $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} {
     catch {exec $cat32 << "You should see this\n" >@stdout} msg
@@ -137,27 +140,27 @@
 } stderr32
 test winpipe-1.17 {32 bit comprehensive tests: to NUL} {pcOnly stdio cat32} {
     # some apps hang when sending a large amount to NUL.  $cat32 isn't one.
-    catch {exec $cat32 < big > nul} msg
+    catch {exec $cat32 < $path(big) > nul} msg
     set msg
 } stderr32
 test winpipe-1.18 {32 bit comprehensive tests: to nowhere} \
 	{pcOnly stdio cat32 .console} {
-    exec $cat32 < big >&@stdout 
+    exec $cat32 < $path(big) >&@stdout 
 } {}
 test winpipe-1.19 {32 bit comprehensive tests: to file handle} {pcOnly stdio cat32} {
-    set f1 [open "stdout" w]
-    set f2 [open "stderr" w]
-    exec $cat32 < little >@$f1 2>@$f2
+    set f1 [open $path(stdout) w]
+    set f2 [open $path(stderr) w]
+    exec $cat32 < $path(little) >@$f1 2>@$f2
     close $f1
     close $f2
-    list [contents stdout] [contents stderr]
+    list [contents $path(stdout)] [contents $path(stderr)]
 } {little stderr32}
 test winpipe-1.20 {32 bit comprehensive tests: write to application} \
 	{pcOnly stdio cat32} {
-    set f [open |[list $cat32 >stdout] w]
+    set f [open |[list $cat32 >$path(stdout)] w]
     puts -nonewline $f "foo"
     catch {close $f} msg
-    list [contents stdout] $msg
+    list [contents $path(stdout)] $msg
 } {foo stderr32}
 test winpipe-1.21 {32 bit comprehensive tests: read/write application} \
 	{pcOnly stdio cat32} {
@@ -187,13 +190,13 @@
 	}
     }
 
-    set f [open "|[list $cat32] < big 2> stderr" r]
+    set f [open "|[list $cat32] < big 2> $path(stderr)" r]
     fconfigure $f  -buffering none -blocking 0
     fileevent $f readable "readResults $f"
     set x 0
     set result ""
     vwait x
-    list $result $x [contents stderr]
+    list $result $x [contents $path(stderr)]
 } "{$big} 1 stderr32"
 
 close [open nothing w]
@@ -279,16 +282,16 @@
     lappend x [catch {close $f} msg] $msg
 } {writable timeout 0 {}}
 
-makeFile {
+set path(echoArgs.tcl) [makeFile {
     puts "[list $argv0 $argv]"
-} echoArgs.tcl
+} echoArgs.tcl]
 
 test winpipe-7.1 {BuildCommandLine: null arguments} {pcOnly stdio} {
-    exec $::tcltest::tcltest echoArgs.tcl foo "" bar
-} {echoArgs.tcl {foo {} bar}}
+    exec $::tcltest::tcltest $path(echoArgs.tcl) foo "" bar
+} [list $path(echoArgs.tcl) {foo {} bar}]
 test winpipe-7.2 {BuildCommandLine: null arguments} {pcOnly stdio} {
-    exec $::tcltest::tcltest echoArgs.tcl foo \" bar
-} {echoArgs.tcl {foo {"} bar}}
+    exec $::tcltest::tcltest $path(echoArgs.tcl) foo \" bar
+} [list $path(echoArgs.tcl) {foo {"} bar}]
 
 # restore old values for env(TMP) and env(TEMP)
 
