diff --git a/src/Testing/Runner.cpp b/src/Testing/Runner.cpp index 2714409..da386a0 100644 --- a/src/Testing/Runner.cpp +++ b/src/Testing/Runner.cpp @@ -221,7 +221,11 @@ namespace Void::Testing bool any = std::any_of( result.assertions.begin(), result.assertions.end(), [](const auto& a) { return !a.passed; }); - result.state = any ? TestState::Failed : TestState::Passed; + // An exception that escaped the body fails it too, with no failed + // assertion recorded. + const bool unhandled = !result.crash_info.empty(); + result.state = + any || unhandled ? TestState::Failed : TestState::Passed; } return result; } @@ -268,7 +272,11 @@ namespace Void::Testing bool any = std::any_of( result.assertions.begin(), result.assertions.end(), [](const auto& a) { return !a.passed; }); - result.state = any ? TestState::Failed : TestState::Passed; + // An exception that escaped the body fails it too, with no failed + // assertion recorded. + const bool unhandled = !result.crash_info.empty(); + result.state = + any || unhandled ? TestState::Failed : TestState::Passed; } return result; }