catchorg / catchorg/Catch2

Separate headers for "extra" std types

Open
#2,851 0 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**
Currently, to add stringification for std::optional, say, you need to define `CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER`. This can be tricky to get right with things like pre-compiled headers, unity builds, or other tricks to speed up the build, without dragging it into every single unit test file in the project.

Given Catch2v3 has already gone down the route of using separate headers for extra functionality, it would be useful to have this option here as well - put the relevant StringMaker specialisations into their own headers. That way, enabling formatted output of these types would just involve adding an extra #include, and it would work just fine with PCH, unity builds, etc.

Contributor guide

Open the contributing guide

Research direction

Start by inspecting Catch2 v3's existing separate headers for extra functionality and locating the StringMaker specialisations for std::optional and other extra standard types. Determine how those headers are included and how the current configuration macro is used. Done means formatted output for these types can be enabled through additional includes without requiring the macro in every unit test file.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.