How to undo fatal error detection in BOOST TEST

I get an error message: unknown location(0): fatal error in "suite_1_test_1": child has exited; pid: 5817; uid: 0; exit value: 255

Inside, suite_1_test_1I run a program Awith execvp()(after fork()), which may end with an error code that is not 0. This error code indicates what happened to the program A.

The problem is that if I get this fatal error, I cannot process the value exit(), but BOOST TESTwill exit immediately.

Is there any way to disable it?

thank

+2
source share
3 answers

Well, this can be done:

boost :: unit_test case fails because the child process exits with nonzero

just do #define BOOST_TEST_IGNORE_NON_ZERO_CHILD_CODE before #define BOOST_TEST_MODULE aot_test_module inmain()

--catch_system_errors=no export BOOST_TEST_CATCH_SYSTEM_ERRORS="no".

+2

, boost , ( ) . "" .

unit test , fork exec * Boost.Test. , . , , . , , , script.

+1

As I understand it, execvp () replaces your test program . So Boost.Test no longer works. It is returned only in case of failure. I would not use it in this context with Boost.Test.

0
source

All Articles