You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a test that if fails should abort all further testing. This is attained with >> fatal:
booltest_create_camera() { ... }
"camera_tests"_test = []{
expect(test_create_camera()) >> fatal) << "Camera was nullptr!";
// more tests here...
};
If I cannot create a camera, all the next tests should be skipped. And I would also like to get the message "Camera was nullptr!" printed. However, I experience that >> fatal simply aborts the program without printing my message.
Instead, I can use this bit of code to do what I want - but it seems more complicated than should be necessary, and it doesn't allow me to forward arbitrary strings to std::cout:
expect(eq(test_create_camera(), "Camera was nullptr!"_b) >> fatal);
Specifications
Version: BOOST_UT_VERSION 1'1'9
Platform: Ubuntu 23.04
Compiler: g++ 12.3.0
The text was updated successfully, but these errors were encountered:
Problem description
Given a test that if fails should abort all further testing. This is attained with
>> fatal
:If I cannot create a camera, all the next tests should be skipped. And I would also like to get the message
"Camera was nullptr!"
printed. However, I experience that>> fatal
simply aborts the program without printing my message.Instead, I can use this bit of code to do what I want - but it seems more complicated than should be necessary, and it doesn't allow me to forward arbitrary strings to
std::cout
:expect(eq(test_create_camera(), "Camera was nullptr!"_b) >> fatal);
Specifications
BOOST_UT_VERSION 1'1'9
Ubuntu 23.04
g++ 12.3.0
The text was updated successfully, but these errors were encountered: