I would like to write a method in my test suite as follows:
void checkParams(arg1, arg2, arg3)
{
BOOST_REQUIRE(arg1==1);
BOOST_REQUIRE(arg2==2);
BOOST_REQUIRE(arg3==3);
}
However, I want to write something to stderr if the assert fails. For example, if the first assert fails, I want to write: checkParams failed with arguments arg1=5, arg2=4, arg3=3
Write now the message it generates is just that critical check failed 5==1.
More generally, I would like to create a stacktrace on failure so that I can see a chain of calls that led to this failure. Note that this method is called by all my BOOST_AUTO_TEST_CASE methods but is not itself a BOOST_AUTO_TEST_CASE.
How do I do this?
Another question: I know I can modify the logging level by providing run time parameters,
./test --log_level=all
How do I set the log_level within code?