build-sys: Enable testing of sigqueue

The referenced commits enavled both pkill and kill to send an integer to
the killed or signalled process. The test_process now will report on the
integer if sent and the testsuite changes take advantage of this
new feature.

Another process make/destroy set had to be made as using spawn
instead of exec changes both the SID and TTY for the underlying
process, making other tests fail.

References:
 commit 7d55409b82
 commit 2b804a532a
This commit is contained in:
Craig Small
2020-04-28 19:40:07 +10:00
parent 7d55409b82
commit 4090fa711b
4 changed files with 90 additions and 29 deletions

View File

@@ -52,6 +52,17 @@ proc expect_pass { testname reg } {
}
}
proc expect_pipeproc_pass { testname reg } {
global pipeproc_spawnid
expect {
-i $pipeproc_spawnid
-re "$reg" { pass "$testname" }
default { fail "$testname" }
timeout { fail "$testname (timeout)" }
}
}
proc expect_blank { testname } {
expect {
-re "\\w" { fail "$testname" }
@@ -60,6 +71,14 @@ proc expect_blank { testname } {
}
}
proc expect_blank_continue { testname } {
expect {
-re "\\w" { fail "$testname" }
eof { }
timeout { pass "$testname (timeout)" }
}
}
proc expect_table { test match_header match_items match_footer } {
expect {
-re "$match_header" {
@@ -117,6 +136,15 @@ proc expect_table_dsc { test match_header match_item } {
#}
}
proc make_pipeproc { } {
global pipeproc_pid pipeproc_spawnid topdir
set testproc_realpath "${topdir}/lib/test_process"
set pipeproc_pid [ spawn $testproc_realpath ]
set pipeproc_spawnid $spawn_id
}
proc make_testproc { } {
global testproc_path testproc_comm testproc_arg_str testproc1_pid testproc2_pid topdir
@@ -157,6 +185,11 @@ proc kill_testproc { } {
file delete $testproc_path
}
proc kill_pipeproc { } {
global pipeproc_pid
kill_process $pipeproc_pid
}
proc get_tty {} {
if { [catch { set raw_tty [ exec tty ] } msg]} {
warning "No TTY found"