[Cppunit-devel] Signal handling in Linux
Brought to you by:
blep
From: Robert W. <ro...@po...> - 2002-03-21 15:56:14
|
Hi, I expect some of my tests to access a null pointer and thus to raise a signal (SIGSGV). I would like to thow an Exception on arrival of any signal to avoid it terminating the program and instead be recorded as a failed or succeded test run. The C++=A0standard does not allow any C++ features being used in signal handler functions, especially no exceptions. I really do not like using a global variable (or singleton) which I=20 check at the end of the test. Can anybody please point me to a more elegant solution? Is there perhaps some kind of compiler setting to map signals to exceptions by default (I use g++)? Thanks in advance Robert |