Re: [Cppunit-devel] Signal handling in Linux
Brought to you by:
blep
From: Baptiste L. <gai...@fr...> - 2002-04-13 14:55:50
|
Is it possible to wrap the signal logic into a class (even if it use global variable) ? I'm planning to add a feature to add 'custom' exception support (export not based on std::exception) to CppUnit. To do that, I just call a must on a class with the Test to run and the TestResult which 'protect ' the test run. In your case, that would means trapping the signal, and throwing adding a failure to TestResult. I'm really interessed into this, because VC++ does this automatically for us in debug mode. This is not the case on Unix, and as such does not provide a consistent behavior across plateform. As a consequence, on Unix, you would need a TestListener that print the test name before running the test, just to now which test failed... Baptiste. ----- Original Message ----- From: "Robert Wenner" <ro...@po...> To: <cpp...@li...> Sent: Thursday, March 21, 2002 5:56 PM Subject: [Cppunit-devel] Signal handling in Linux 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++ standard 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 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 _______________________________________________ Cppunit-devel mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppunit-devel |