catchorg / catchorg/Catch2

Group test case and sections in it together

Open
#2,296 3 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**
It is really easy to read the code with sections inside test cases.
I wish the same could be done for the console output.

**Additional context**
Current output
```
-------------------------------------------------------------------------------
TEST 1
SECTION 1
-------------------------------------------------------------------------------
some/test/some/file:some_line
...............................................................................

some/test/some/file:some_line: PASSED:
REQUIRE_FALSE( ...)
with expansion:
!false

some/test/some/file:some_line: PASSED:
REQUIRE_FALSE(... )
with expansion:
!false

-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
TEST 1
SECTION 2
-------------------------------------------------------------------------------
some/test/some/file:some_line
...............................................................................

some/test/some/file:some_line: PASSED:
REQUIRE_FALSE( ...)
with expansion:
!false

some/test/some/file:some_line: PASSED:
REQUIRE_FALSE(... )
with expansion:
!false

-------------------------------------------------------------------------------
```

I suggest
```
===============================================================================
TEST 1
SECTION 1: some/test/some/file:some_line
-------------------------------------------------------------------------------

some/test/some/file:some_line: PASSED:
REQUIRE_FALSE( ...)
with expansion:
!false

some/test/some/file:some_line: PASSED:
REQUIRE_FALSE(... )
with expansion:
!false

SECTION 2: some/test/some/file:some_line
-------------------------------------------------------------------------------

some/test/some/file:some_line: PASSED:
REQUIRE_FALSE( ...)
with expansion:
!false

some/test/some/file:some_line: PASSED:
REQUIRE_FALSE(... )
with expansion:
!false
===============================================================================
```

This would make it so much easier to read.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the current console output shown in the issue and tracing Catch2's console-reporting path. Done means test cases and their sections are grouped in the output as illustrated, while preserving the reported assertion details.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.