autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to check for SIGABRT?


From: Russ Allbery
Subject: Re: How to check for SIGABRT?
Date: Fri, 08 Dec 2017 14:51:48 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Simon Sobisch <address@hidden> writes:

> We use the autoconf generated testsuite script in GnuCOBOL to test the
> compiler and runtime - and it works very well for "normal" tests.

> There are some tests where the compiler should abort and it does, but
> when it does so "correctly" by raising SIGABRT we can check for return
> code 134 but get an additional stderr message similar to
> "/full/path/to/testsuite.de/testcasenumber/run aborted on line 40" (and
> I don't know if SIGABRT will result in return code 134 on all "exotic"
> systems).

> The following options come to mind:

> * use `trap` in AT_CHECK to catch the error if it is the expected result
> --> should fix the additional stderr, we still would have to check for
> return code 134

> * use some builtin expectation similar to XFAIL(true) - but I don't
> found anything like this in the docs

> * when running the testsuite (we have one case where we check this via
> an environment variable set in atlocal and return 77 for skipping the
> test if the compiler cannot use an external tool) don't raise SIGABRT
> but something like `exit 96`

> Do you have any experience/thoughts about this?

Personally, I'd make the actual test a tiny C program that execs argv,
waits for it to exit, and then inspects the resulting exit status to see
if it died with SIGABRT.

-- 
Russ Allbery (address@hidden)              <http://www.eyrie.org/~eagle/>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]