Jim Tcl
Check-in [713502fb49]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:tests: exec2-3.2 now passes on OpenBSD

Reported-by: Stuart Cassoff <stwo@bell.net> Signed-off-by: Steve Bennett <steveb@workware.net.au>

Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 713502fb49edc38f7acf53f5078cca483ea1046c
User & Date: steveb@workware.net.au 2017-11-04 09:16:00
Context
2017-11-04
09:16
interp: command should be created in the global namespace

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: c6eab746a7 user: steveb@workware.net.au tags: trunk

09:16
tests: exec2-3.2 now passes on OpenBSD

Reported-by: Stuart Cassoff <stwo@bell.net> Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 713502fb49 user: steveb@workware.net.au tags: trunk

2017-10-21
03:25
tests: Use a more explicit approach to test SIGPIPE

Write to a closed pipe in exec2-3.2 to force SIGPIPE

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: b1f8a31bdc user: steveb@workware.net.au tags: trunk

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tests/exec2.test.

48
49
50
51
52
53
54
55
56
57
58
59
60


61
62
63
64
65
66
67
68
test exec2-3.1 "close pipeline return value" {
	set f [open |false]
	set rc [catch {close $f} msg opts]
	lassign [dict get $opts -errorcode] status pid exitcode
	list $rc $msg $status $exitcode
} {1 {child process exited abnormally} CHILDSTATUS 1}

# Note that on at least one Windows system, this fails to return SIGPIPE
# and cat simply fails instead. How to it simply returns 
test exec2-3.2 "close pipeline return value" -constraints pipe -body {
	# Create a pipe and immediately close the read end
	lassign [pipe] r w
	close $r


	set bigstring [string repeat a 10000]
	set f [open [list |cat << $bigstring >$@w]]
	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.4 "wait for background task" {







<
<




>
>
|







48
49
50
51
52
53
54


55
56
57
58
59
60
61
62
63
64
65
66
67
68
test exec2-3.1 "close pipeline return value" {
	set f [open |false]
	set rc [catch {close $f} msg opts]
	lassign [dict get $opts -errorcode] status pid exitcode
	list $rc $msg $status $exitcode
} {1 {child process exited abnormally} CHILDSTATUS 1}



test exec2-3.2 "close pipeline return value" -constraints pipe -body {
	# Create a pipe and immediately close the read end
	lassign [pipe] r w
	close $r
	# 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 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.4 "wait for background task" {