[FR]: Allow EXPECT_NONFATAL_FAILURE and EXPECT_FATAL_FAILURE to expect more than one failure
- Dominant language
- C++
- Stars
- 39.5k
- Forks
- 10.9k
- Avg merge
- 6d 13h
- Merged PRs (30d)
- 1
Description
### Does the feature exist in the most recent commit?
No
### Why do we need this feature?
GoogleTest and GoogleMock allow multiple failures to be thrown. By using, for example, `EXPECT_THAT...`.
GoogleTest also allows it to be used as an foundation/framework for other test frameworks. I so happen to be doing exactly that. And I have multiple tests that would have multiple EXPECT calls to fail in one test.
However, EXPECT_NONFATAL_FAILURE and EXPECT_FATAL_FAILURE only allow for one error to be thrown.
### Describe the proposal.
Either extend/augment the function-like-macro for EXPECT_NONFATAL_FAILURE and EXPECT_FATAL_FAILURE to accept an integer for the amount of failures _or_ allow the substr to be of a list/initializerlist/vector type to expect multiple (different?) substrings.
_or_
Add a second pair of EXPECT_NONFATAL_FAILURE and EXPECT_FATAL_FAILURE, for example, EXPECT_MULTIPLE_NONFATAL_FAILURE and its brother EXPECT_MULTIPLE_FATAL_FAILURE taking a list of substr to match against.
### Is the feature specific to an operating system, compiler, or build system version?
No
Contributor guide
Research direction
Start by locating the existing EXPECT_NONFATAL_FAILURE and EXPECT_FATAL_FAILURE macro implementations and their tests. Compare how they capture and match failures, then clarify whether the intended change is a failure count, multiple substrings, or new macros. Done means a decided API supports multiple expected failures with corresponding coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100