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
Describe the bug
After CHECKED_ELSE(true) {} is being run, any exception being thrown in the tests are suppressed and treated as passing when using xml reporter. Using console reporter reports failure.
After CHECKED_ELSE(false) {} is being run, any exception being thrown are suppressed in both console and xml reporter.
Expected behavior
Both the console reporter and xml reporter should behave exactly the same, that the exception is reported and test counted as failure in both cases.
Reproduction steps
Steps to reproduce the bug.
#include <catch2/catch_test_macros.hpp>
#include <exception>
TEST_CASE("Testing") {
CHECKED_ELSE(true) {}
throw std::runtime_error("it is an error");
}
...
/home/ross/workspace/catch2-xml/test.cpp:4: FAILED:
{Unknown expression after the reported line}
due to unexpected exception with message:
it is an error
===============================================================================
test cases: 1 | 1 failed
assertions: 2 | 1 passed | 1 failed
And if the argument inside CHECKED_ELSE is false, exception is suppressed for both console and xml reporter. It also looks like a bug.
#include <catch2/catch_test_macros.hpp>
#include <exception>
TEST_CASE("Testing") {
CHECKED_ELSE(false) {}
throw std::runtime_error("it is an error");
}
Describe the bug
After CHECKED_ELSE(true) {} is being run, any exception being thrown in the tests are suppressed and treated as passing when using xml reporter. Using console reporter reports failure.
After CHECKED_ELSE(false) {} is being run, any exception being thrown are suppressed in both console and xml reporter.
Expected behavior
Both the console reporter and xml reporter should behave exactly the same, that the exception is reported and test counted as failure in both cases.
Reproduction steps
Steps to reproduce the bug.
Running it with
./test -r xml
And running it directly with
./test
And if the argument inside CHECKED_ELSE is false, exception is suppressed for both console and xml reporter. It also looks like a bug.
Running
./test -r xml
Running
./test
Platform information:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: