catchorg / catchorg/Catch2

Split same named SECTION but execute all at once

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

Description

**Description**
I want to have a possibility to split a section to use common code between same named sections.

```
TEST_CASE("test") {

// Prepare.
int i = 0;

SECTION("A") { i = 1; }
SECTION("B") { i = 2; }

// Common code here.

SECTION("A") { i++; }
SECTION("B") { i--; }

CHECK(i == 2);

}
```

Both SECTIONs A should be executed on the same test case. Currently the first section A will be tested, later the other section A (same for section B).

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.