mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-03 13:55:39 +02:00
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.
This commit is contained in:
@@ -12165,7 +12165,7 @@ C
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
<Original>
|
||||
config.useColour == UseColour::Auto
|
||||
config.colourMode == ColourMode::PlatformDefault
|
||||
</Original>
|
||||
<Expanded>
|
||||
0 == 0
|
||||
@@ -12179,7 +12179,7 @@ C
|
||||
<Section name="auto" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
<Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
<Original>
|
||||
cli.parse({"test", "--use-colour", "auto"})
|
||||
cli.parse( { "test", "--colour-mode", "default" } )
|
||||
</Original>
|
||||
<Expanded>
|
||||
{?}
|
||||
@@ -12187,7 +12187,7 @@ C
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
<Original>
|
||||
config.useColour == UseColour::Auto
|
||||
config.colourMode == ColourMode::PlatformDefault
|
||||
</Original>
|
||||
<Expanded>
|
||||
0 == 0
|
||||
@@ -12201,7 +12201,7 @@ C
|
||||
<Section name="yes" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
<Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
<Original>
|
||||
cli.parse({"test", "--use-colour", "yes"})
|
||||
cli.parse({"test", "--colour-mode", "ansi"})
|
||||
</Original>
|
||||
<Expanded>
|
||||
{?}
|
||||
@@ -12209,7 +12209,7 @@ C
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
<Original>
|
||||
config.useColour == UseColour::Yes
|
||||
config.colourMode == ColourMode::ANSI
|
||||
</Original>
|
||||
<Expanded>
|
||||
1 == 1
|
||||
@@ -12223,7 +12223,7 @@ C
|
||||
<Section name="no" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
<Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
<Original>
|
||||
cli.parse({"test", "--use-colour", "no"})
|
||||
cli.parse({"test", "--colour-mode", "none"})
|
||||
</Original>
|
||||
<Expanded>
|
||||
{?}
|
||||
@@ -12231,10 +12231,10 @@ C
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
<Original>
|
||||
config.useColour == UseColour::No
|
||||
config.colourMode == ColourMode::None
|
||||
</Original>
|
||||
<Expanded>
|
||||
2 == 2
|
||||
3 == 3
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="2" failures="0" expectedFailures="0"/>
|
||||
@@ -12256,7 +12256,7 @@ C
|
||||
result.errorMessage(), ContainsSubstring( "colour mode must be one of" )
|
||||
</Original>
|
||||
<Expanded>
|
||||
"colour mode must be one of: auto, yes or no. 'wrong' not recognised" contains: "colour mode must be one of"
|
||||
"colour mode must be one of: default, ansi, win32, or none. 'wrong' not recognised" contains: "colour mode must be one of"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="2" failures="0" expectedFailures="0"/>
|
||||
|
Reference in New Issue
Block a user