Skip to content

Add STDOUT_REPORTER to catch_discover_tests - #3248

Open
wozhenbang2004 wants to merge 6 commits into
catchorg:develfrom
wozhenbang2004:2824-stdout-reporter
Open

wozhenbang2004 wants to merge 6 commits into
catchorg:develfrom
wozhenbang2004:2824-stdout-reporter

Conversation

@wozhenbang2004

Copy link
Copy Markdown

Description

Adds STDOUT_REPORTER for console output alongside the existing per-test file reporter:

catch_discover_tests(tests
    STDOUT_REPORTER console::colour-mode=ansi
    REPORTER junit
    OUTPUT_DIR reports
    OUTPUT_SUFFIX .xml
)

The stdout reporter explicitly targets -, so OUTPUT_DIR continues to apply to REPORTER. The option also works on its own and supports extended reporter options such as colour-mode.

Added a CMake helper test covering PRE_TEST and POST_BUILD, stdout-only and file-only calls, and report paths containing spaces. It passes with Unix Makefiles and Ninja Multi-Config (Debug).

The basic-tests preset with CATCH_ENABLE_CMAKE_HELPER_TESTS=ON also passes (86 CTest tests).

GitHub Issues

Refs #2824. This implements the stdout plus per-test file case proposed in the issue.

@codecov

codecov Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.39%. Comparing base (36c1bc3) to head (24818ab).

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #3248      +/-   ##
==========================================
- Coverage   91.43%   91.39%   -0.03%     
==========================================
  Files         205      205              
  Lines        9108     9108              
==========================================
- Hits         8327     8324       -3     
- Misses        781      784       +3     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant