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 /docs/command-line.md | |
| 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 'docs/command-line.md')
| -rw-r--r-- | docs/command-line.md | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/docs/command-line.md b/docs/command-line.md index 7ace0530..29e6a365 100644 --- a/docs/command-line.md +++ b/docs/command-line.md @@ -67,7 +67,7 @@ Click one of the following links to take you straight to that option - or scroll <a href="#benchmark-confidence-interval"> ` --benchmark-confidence-interval`</a><br /> <a href="#benchmark-no-analysis"> ` --benchmark-no-analysis`</a><br /> <a href="#benchmark-warmup-time"> ` --benchmark-warmup-time`</a><br /> -<a href="#use-colour"> ` --use-colour`</a><br /> +<a href="#colour-mode"> ` --colour-mode`</a><br /> <a href="#test-sharding"> ` --shard-count`</a><br /> <a href="#test-sharding"> ` --shard-index`</a><br /> <a href=#no-tests-override> ` --allow-running-no-tests`</a><br /> @@ -457,16 +457,26 @@ filename it is found in, with any extension stripped, prefixed with the `#` char So, for example, tests within the file `~\Dev\MyProject\Ferrets.cpp` would be tagged `[#Ferrets]`. -<a id="use-colour"></a> +<a id="colour-mode"></a> ## Override output colouring -<pre>--use-colour <yes|no|auto></pre> +<pre>--colour-mode <ansi|win32|none|default></pre> -Catch colours output for terminals, but omits colouring when it detects that -output is being sent to a pipe. This is done to avoid interfering with automated -processing of output. +Catch2 support two different ways of colouring terminal output, and by +default it attempts to make a good guess on which implementation to use +(and whether to even use it, e.g. Catch2 tries to avoid writing colour +codes when writing the results into a file). + +`--colour-mode` allows the user to explicitly select what happens. + +* `--colour-mode ansi` tells Catch2 to always use ANSI colour codes, even +when writing to a file +* `--colour-mode win32` tells Catch2 to use colour implementation based + on Win32 terminal API +* `--colour-mode none` tells Catch2 to disable colours completely +* `--colour-mode default` lets Catch2 decide + +`--colour-mode default` is the default setting. -`--use-colour yes` forces coloured output, `--use-colour no` disables coloured -output. The default behaviour is `--use-colour auto`. <a id="test-sharding"></a> ## Test Sharding |