From 340d0a09b7b4ed64c00d86fa8076570627963059 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Mon, 13 Jun 2022 10:24:27 +1000 Subject: tests: Fix SIGPIPE tests These tests were only working accidentally (typo >$@w). In fact since open |... already provides a pipe on output there is no need to create one manually, so the first test can run under Tcl too. Signed-off-by: Steve Bennett --- tests/exec2.test | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/exec2.test b/tests/exec2.test index b1d0263..ce5f24b 100644 --- a/tests/exec2.test +++ b/tests/exec2.test @@ -67,28 +67,22 @@ test exec2-3.1 "close pipeline return value" pipe { list $rc $msg $status $exitcode } {1 {child process exited abnormally} CHILDSTATUS 1} -test exec2-3.2 "close pipeline return value" -constraints {jim pipe nomingw32} -body { - # Create a pipe and immediately close the read end - lassign [pipe] r w - close $r +test exec2-3.2 "close pipeline return value" -constraints {pipe nomingw32} -body { # Write more than 64KB which is maximum size of the pipe buffers # on all systems we have seen set bigstring [string repeat a 100000] - set f [open [list |cat << $bigstring >$@w]] + set f [open [list |cat << $bigstring]] set rc [catch {close $f} msg opts] lassign [dict get $opts -errorcode] status pid exitcode list $rc $msg $status $exitcode } -match glob -result {1 {child killed*} CHILDKILLED SIGPIPE} test exec2-3.3 "close pipeline with SIGPIPE blocked" -constraints {pipe signal nomingw32} -body { - # Create a pipe and immediately close the read end - lassign [pipe] r w - close $r signal block SIGPIPE # Write more than 64KB which is maximum size of the pipe buffers # on all systems we have seen set bigstring [string repeat a 100000] - set f [open [list |cat << $bigstring >$@w 2>/dev/null]] + set f [open [list |cat << $bigstring 2>/dev/null]] set rc [catch {close $f} msg opts] lassign [dict get $opts -errorcode] status pid exitcode list $rc $msg $status $exitcode -- cgit v1.1