diff options
author | dgp <dgp@users.sourceforge.net> | 2004-02-25 23:56:58 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2004-02-25 23:56:58 (GMT) |
commit | 9f1913a0d8f82a07b0ed1500f3b3d31d3ff0f9c6 (patch) | |
tree | c4e71eedeebec78847b456ffa6f2bd451c9a92d3 /tests/socket.test | |
parent | f8f2edda8715ea332ecf36f0b07d45d662f9a9ff (diff) | |
download | tcl-9f1913a0d8f82a07b0ed1500f3b3d31d3ff0f9c6.zip tcl-9f1913a0d8f82a07b0ed1500f3b3d31d3ff0f9c6.tar.gz tcl-9f1913a0d8f82a07b0ed1500f3b3d31d3ff0f9c6.tar.bz2 |
* tests/basic.test: Made several tests more robust to the
* tests/cmdMZ.test: list-quoting of path names that might
* tests/exec.test: contain Tcl-special chars like { or [.
* tests/io.test: Should help us sort out Tcl Bug 554068.
* tests/pid.test:
* tests/socket.test:
* tests/source.test:
* tests/unixInit.test:
Diffstat (limited to 'tests/socket.test')
-rw-r--r-- | tests/socket.test | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/tests/socket.test b/tests/socket.test index 3719b0f..a5d9153 100644 --- a/tests/socket.test +++ b/tests/socket.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: socket.test,v 1.27 2003/10/07 21:45:39 dgp Exp $ +# RCS: @(#) $Id: socket.test,v 1.28 2004/02/25 23:56:59 dgp Exp $ # Running socket tests with a remote server: # ------------------------------------------ @@ -1415,17 +1415,19 @@ test socket-12.1 {testing inheritance of server sockets} {socket stdio exec} { set f [open $path(script2) w] puts $f [list set tcltest [interpreter]] - puts $f [format { + puts -nonewline $f { set f [socket -server accept 0] puts [lindex [fconfigure $f -sockname] 2] proc accept { file addr port } { close $file } - exec $tcltest "%s" & + exec $tcltest } + puts $f [list $path(script1) &] + puts $f { close $f after 1000 exit vwait forever - } $path(script1)] + } close $f # Launch script2 and wait 5 seconds @@ -1469,15 +1471,17 @@ test socket-12.2 {testing inheritance of client sockets} {socket stdio exec} { set f [open $path(script2) w] puts $f [list set tcltest [interpreter]] - puts $f [format { + puts -nonewline $f { gets stdin port set f [socket 127.0.0.1 $port] - exec $tcltest "%s" & + exec $tcltest } + puts $f [list $path(script1) &] + puts $f { puts $f testing flush $f after 1000 exit vwait forever - } $path(script1)] + } close $f # Create the server socket @@ -1547,17 +1551,23 @@ test socket-12.3 {testing inheritance of accepted sockets} {socket stdio exec} { set f [open $path(script2) w] puts $f [list set tcltest [interpreter]] - puts $f [format { + puts -nonewline $f { set server [socket -server accept 0] puts stdout [lindex [fconfigure $server -sockname] 2] - proc accept { file host port } { + proc accept { file host port } } + puts $f \{ + puts -nonewline $f { global tcltest puts $file {test data on socket} - exec $tcltest "%s" & + exec $tcltest } + puts $f [list $path(script1) &] + puts $f { after 1000 exit } + puts $f \} + puts $f { vwait forever - } $path(script1)] + } close $f # Launch the script2 process and connect to it. See how long |