catchorg / catchorg/Catch2

Display custom report if test case fails

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

Description

## Description

Hey I would like to display custom debug data when I run my test, but only if the test fails. So, if the test passes, nothing is displayed, and if the test fails, I have extra information to help me see what is going on.

So, the feature would be something like :
```CPP

TEST_CASE(...) {
...
IF_TEST_CASE_FAILED() {
std::cout << "Here is a complete report of the behaviour of your program, enjoy !" << std::endl;
}
} // End TEST_CASE
```

If it's already possible to do such thing, thanks for letting me know ! Otherwise, this is something that can be implemented :)

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.