-
-
Notifications
You must be signed in to change notification settings - Fork 649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logging not Working for me #227
Comments
Even with the unit test from the source code nothing appear: static int someTests() {
int some_var = 42;
INFO("lots of captures - some on heap: " << some_var << " " << some_var << " " << some_var << ";");
FAIL_CHECK("forcing the many captures (including those on the heap) to be stringified");
return some_var;
}
TEST_CASE("a test case that will end from an exception") {
int some_var = someTests();
INFO("someTests() returned: " << some_var); // note that we have to use a local variable - cannot pass a temporary
INFO("this should be printed if an exception is thrown even if no assert has failed: " << some_var);
{
INFO("in a nested scope this should be printed as well: " << some_var);
{
INFO("this should not be printed");
CAPTURE(some_var);
}
CHECK_MESSAGE(some_var == 666, "why is this not 666 ?!");
}
} |
logged context with INFO is shown only if an assert fails. In your first example it seems that the assert is successful - note that it isn't checking for a true condition, but for a false one - meaning that As for the second example - I do get output and it looks like this (precisely what I would expect):
So... are you sure you aren't executing the binary from the second example with |
I just misunderstood the context, I think it's was permanent logging, I want a permanent logging for each run ! |
In that case you should make use of |
Perfect, thank's a lot, the documentation was not evident for me ! |
Description
Write a simple log inside a test:
Steps to reproduce
Write a simple test with logging
Extra information
The text was updated successfully, but these errors were encountered: