[unittest] How to only ignore child terminate?
I have a code that is run from the tests that I am running which does child.terminate(). That is considered a system error, therefore, I would have to set catch_system_errors="no" in order to ignore it. But the downside is I miss the rest of system errors I might be interested in. How can I only ignore child.terminate() while running unittests? Thanks in advance
On Tue, 25 Jan 2011 21:49:38 +0100, Firouzeh Jalilian
I have a code that is run from the tests that I am running which does child.terminate(). That is considered a system error, therefore, I would have to set catch_system_errors="no" in order to ignore it. But the downside is I miss the rest of system errors I might be interested in.
How can I only ignore child.terminate() while running unittests?
If it's a problem with SIGCHLD rebuild your test with BOOST_TEST_IGNORE_SIGCHLD. HTH, Boris
[Please do not mail me a copy of your followup] boost-users@lists.boost.org spake the secret code <875837.92076.qm@web161215.mail.bf1.yahoo.com> thusly:
How can I only ignore child.terminate() while running unittests?
Decouple the code from the concrete behavior of this function and use a test double in testing scenarios. One way to do this would be to extract the text that calls child.terminate() into its own virtual method and override that method in testing. -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/ Legalize Adulthood! http://legalizeadulthood.wordpress.com
participants (3)
-
Boris Schaeling
-
Firouzeh Jalilian
-
legalize+jeeves@mail.xmission.com