Merge xqa-02-runner-count: count failures independently of retention (X-QA-02)
This commit is contained in:
commit
2501c4d7ac
4 files changed
+36
-6
No files matched your search
@@ -34,6 +34,7 @@ void handle_assertion(AssertionResult result)
|
||||
|
||||
if (!passed) {
|
||||
tr->state = TestState::Failed;
|
||||
++tr->failed_assertions;
|
||||
}
|
||||
|
||||
const std::size_t entry_bytes =
|
||||
|
||||
@@ -115,6 +115,12 @@ namespace Void::Testing
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Failures are counted when recorded (TestResult::failed_assertions),
|
||||
// independently of the bounded assertion vector kept for reporting.
|
||||
[[nodiscard]] bool has_recorded_failure(const TestResult& result) noexcept
|
||||
{
|
||||
return result.failed_assertions > 0;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
RunConfig Runner::parse_args(int argc, char** argv)
|
||||
@@ -325,9 +331,7 @@ namespace Void::Testing
|
||||
|
||||
if (result.state != TestState::Skipped &&
|
||||
result.state != TestState::Crashed) {
|
||||
bool any = std::any_of(
|
||||
result.assertions.begin(), result.assertions.end(),
|
||||
[](const auto& a) { return !a.passed; });
|
||||
const bool any = has_recorded_failure(result);
|
||||
// An exception that escaped the body fails it too, with no failed
|
||||
// assertion recorded.
|
||||
const bool unhandled = !result.crash_info.empty() || !result.cleanup_error.empty();
|
||||
@@ -376,9 +380,7 @@ namespace Void::Testing
|
||||
|
||||
if (result.state != TestState::Skipped &&
|
||||
result.state != TestState::Crashed) {
|
||||
bool any = std::any_of(
|
||||
result.assertions.begin(), result.assertions.end(),
|
||||
[](const auto& a) { return !a.passed; });
|
||||
const bool any = has_recorded_failure(result);
|
||||
// An exception that escaped the body fails it too, with no failed
|
||||
// assertion recorded.
|
||||
const bool unhandled = !result.crash_info.empty() || !result.cleanup_error.empty();
|
||||
|
||||
Reference in new issue
Block a user