Boost Test Library is a very useful unit test framework. However, one thing that I don't like is that during the unit test, when errors occur, it will inform the user, but not about the program itself. Let me clarify using BOOST_CHECK as an example:
i=3;
j=4;
BOOST_CHECK(i==j);
The above test case will fail. So checking the details to find out why this test fails will be very interesting. In this case, it will be necessary to print some variables or perform more complex operations, such as writing a file to disk in the program, if it knows that the unit test failed. However, BOOST_CHECK will not return a value to indicate whether the test is successful or not. An ideal function should work as follows:
i=3;
j=4;
if(Enhanced_BOOST_CHECK(i==j) == failed)
{
}
So my question is: Does the BOOST Test Library support this feature? Thank you
source
share