Subject: Re: bug#79077: host_execute and non-zero exit status

From: Jacob Bachmeyer <[email-masked]>
Date: Wed, 23 Jul 2025 22:08:43 -0500

On 7/23/25 02:31, Marc Nieper-Wißkirchen wrote:
> Hi,
>
> The host_execute procedure in dejagnu.exp (see [1]) doesn't seem to
> check the exit status of the executed test programs. A test program
> that simply aborts (e.g. using the C function of the same name) won't
> cause any testsuite failures. This seems brittle and like a
> misfeature.
>
> What is the supposed way to deal with this?

The host_execute procedure is intended for running unit test programs 
that speak a special DejaGnu protocol and ignoring exit codes from unit 
test programs is intended.  The DejaGnu unit testing protocol does not 
depend on the exit code of the unit test program at all, because that 
exit code might not be available in all environments.

Instead, DejaGnu expects an explicit "END" token from the unit test 
program to indicate that the program has reached its intended 
completion.  A warning is produced if this token is not observed; 
perhaps a future version of DejaGnu should insert an UNRESOLVED result 
like we currently do when a Tcl test script aborts?

-- Jacob