catchorg / catchorg/Catch2

Facility for generic test failure condition checked at the end of every test

Open
#1,610 2 comments 0 reactions 0 assignees View on GitHub
Feature Request
Dominant language
C++
Stars
21.5k
Forks
3.5k
Avg merge
3d 16h
Merged PRs (30d)
2

Description

**Description**
On a project I'm contributing to I would like to be able to add a generic condition for test failure. Specifically, I want any test to fail if any log message at ERROR severity happened during the test.

I can test for the condition in the `sectionEnded` or `testCaseEnded` callback from a listener, but I don't think there's any way to cause the test to fail at that point (which makes sense, because the stats have already been assembled at that point, and success or failure has already been established).

Is there a sensible way to achieve what I want? If not, could it be added e.g. via an additional listener callback?

**Additional context**
This arose while working on [this change](https://github.com/CleverRaven/Cataclysm-DDA/pull/29873).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.