This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: On the use of abort() in the testsuite


IainS <developer@sandoe-acoustics.co.uk> writes:

> So... I wonder what does abort() offer to the testsuite?
>
>  that, for example,   _exit(-(__LINE__)) ;
>
> doesn't?

The testsuite can be run on embedded systems over serial ports, where
is sometimes limited communication available.  Each test has to give
one of two responses: success or failure.  Embedded systems do not
reliably return the value passed to the exit function, and in any case
it seemed to make sense to use two different functions for the two
responses.  So we picked exit(0) and abort().  All the tests are
written that way (or at least that was the goal).

Using two functions is flexible in a different way: it means that you
can compile the testsuite with -Dabort=my_favorite_abort and link
against your own library.  So do that.  You can do this with magic in
site.exp, but don't ask me what that magic is because I no longer
remember.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]