diff options
| author | Martin Hořeňovský | 2022-03-27 23:35:41 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2022-03-28 13:10:13 +0200 |
| commit | 1a8a793178d50b74b0f9a0adb3eec937b61039a9 (patch) | |
| tree | 2a8cadf3fa4478f1a11548485a4a0389d4920d2d /src/catch2/catch_session.cpp | |
| parent | a4e4e82474f894d56cbe86e13a2d23bb1b46744d (diff) | |
| download | catch3-1a8a793178d50b74b0f9a0adb3eec937b61039a9.tar.gz | |
Refactor colour handling to prepare for per-reporter colour modes
This includes always compiling the ANSI and None colour
implementations, as they don't need to touch any platform
specific APIs, and removing their respective compile-time
configuration options.
Because the Win32 colour implementation requires Win32-specific
APIs, it is still hidden behind a compile-time toggle,
`CATCH_CONFIG_COLOUR_WIN32` (renamed from `..._COLOUR_WINDOWS`).
The commandline options for colours were also changed. The
option now uses different name, and allows to select between
different implementations, rather than changing whether
the compiled-in colour implementation is used through
"yes/no/default" options.
Diffstat (limited to 'src/catch2/catch_session.cpp')
| -rw-r--r-- | src/catch2/catch_session.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/catch2/catch_session.cpp b/src/catch2/catch_session.cpp index c685e48b..6af52685 100644 --- a/src/catch2/catch_session.cpp +++ b/src/catch2/catch_session.cpp @@ -152,7 +152,8 @@ namespace Catch { m_startupExceptions = true; auto errStream = makeStream( "%stderr" ); - auto colourImpl = makeColourImpl( &config(), errStream.get() ); + auto colourImpl = makeColourImpl( + ColourMode::PlatformDefault, errStream.get() ); auto guard = colourImpl->guardColour( Colour::Red ); errStream->stream() << "Errors occurred during startup!" << '\n'; // iterate over all exceptions and notify user @@ -197,7 +198,7 @@ namespace Catch { config(); getCurrentMutableContext().setConfig(m_config.get()); auto errStream = makeStream( "%stderr" ); - auto colour = makeColourImpl( &config(), errStream.get() ); + auto colour = makeColourImpl( ColourMode::PlatformDefault, errStream.get() ); errStream->stream() << colour->guardColour( Colour::Red ) |