summaryrefslogtreecommitdiff
path: root/tests/thelp.pl
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2022-11-06 14:14:28 -0500
committerPaul Smith <psmith@gnu.org>2022-11-13 10:39:48 -0500
commitdeb4ff272a589d74950e120b800a35e212261f75 (patch)
treee1351d5713f176b73b74c06aa01a6af883417456 /tests/thelp.pl
parente80ce6fc90e1dc5da5c538167ac7ad719bb92b89 (diff)
downloadmake-git-deb4ff272a589d74950e120b800a35e212261f75.tar.gz
[SV 63315] tests: Simplify TERM signaling
Tests that try to kill the make process were not behaving as expected on OpenBSD: the signal was sent from make to its children but the sleep didn't die. Something odd about the way the shell treats TERM. To reduce platform dependencies add "term" to the helper tool and run that instead of kill / sleep. * tests/thelp.pl: Add a new operation "term" that takes a PID. * tests/scripts/features/output-sync: Use it. * tests/scripts/features/temp_stdin: Ditto.
Diffstat (limited to 'tests/thelp.pl')
-rwxr-xr-xtests/thelp.pl7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/thelp.pl b/tests/thelp.pl
index 993339cb..c243bcb8 100755
--- a/tests/thelp.pl
+++ b/tests/thelp.pl
@@ -16,6 +16,7 @@
# wait <word> : wait for a file named <word> to exist
# tmout <secs> : Change the timeout for waiting. Default is 4 seconds.
# sleep <secs> : Sleep for <secs> seconds then echo <secs>
+# term <pid> : send SIGTERM to PID <pid>
# fail <err> : echo <err> to stdout then exit with error code err
#
# If given -q only the "out" command generates output.
@@ -95,6 +96,12 @@ sub op {
return 1;
}
+ if ($op eq 'term') {
+ print "term $nm\n";
+ kill('TERM', $nm);
+ return 1;
+ }
+
if ($op eq 'fail') {
print "fail $nm\n";
exit($nm);