summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2024-01-05 21:10:00 -0700
committerKaz Kylheku <kaz@kylheku.com>2024-01-05 21:10:00 -0700
commit21cbb5fc5ac9015018134d3800dc093bb9bce004 (patch)
tree5f48801ee2a5ba0d2d83791deef392ae41de5439
parent265cf4d251285e247090b4f2b46ec01568efb4e3 (diff)
downloadtxr-21cbb5fc5ac9015018134d3800dc093bb9bce004.tar.gz
txr-21cbb5fc5ac9015018134d3800dc093bb9bce004.tar.bz2
txr-21cbb5fc5ac9015018134d3800dc093bb9bce004.zip
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.
-rw-r--r--tests/007/except-3.txr2
-rw-r--r--tests/007/except-4.txr5
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")