From 21cbb5fc5ac9015018134d3800dc093bb9bce004 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 5 Jan 2024 21:10:00 -0700 Subject: tests: fix tests/007/except-4.txr for Solaris, BSD. * tests/007/except-4.txr: The portable way to get a shell command that exits with a signal is to execute kill -KILL $$. If we use a signal that the shell catch like SIGTERM or SIGINT, we get nonportable behaviors. Some shells seem to catch the signal and then raise it again so they terminate with that signal. Some shells terminate normally, but create an exit status by OR-ing 0x80 with the caught signal. Let's use kill -KILL here and drop the tests for BSD and Solaris. * tests/007/except-3.txr: Fix the kill command here also. While this test wasn't failing on those platforms, it succeeds vacuously, since the exception being ignored by :nothrow is not actually thrown. --- tests/007/except-3.txr | 2 +- tests/007/except-4.txr | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/007/except-3.txr b/tests/007/except-3.txr index b2abc04e..f672c7d2 100644 --- a/tests/007/except-3.txr +++ b/tests/007/except-3.txr @@ -1,3 +1,3 @@ -@(next (open-command "echo foo; kill $$") :nothrow) +@(next (open-command "echo foo; kill -KILL $$") :nothrow) @a @(do (put-line a)) diff --git a/tests/007/except-4.txr b/tests/007/except-4.txr index 3c19cb89..50c85539 100644 --- a/tests/007/except-4.txr +++ b/tests/007/except-4.txr @@ -1,9 +1,6 @@ @(include "../common") -@(if (meq (os-symbol) :openbsd :solaris)) -@ (do (put-line "bar") (exit t)) -@(end) @(try) -@(next (open-command "echo foo; kill $$")) +@(next (open-command "echo foo; kill -KILL $$")) @a @(catch) @(bind a "bar") -- cgit v1.2.3