mirror of
https://github.com/catchorg/Catch2.git
synced 2025-10-17 23:55:39 +02:00
Add --force-colour option to force colour output.
Adding a --force-colour option to force colour output on POSIX systems, provided a debugger is not attached. This allows for Catch to output colours even if STDOUT is not a tty, which can be the case when the test executable is being spawned by a parent process (e.g. CMake's ctest).
This commit is contained in:
@@ -143,7 +143,8 @@ namespace {
|
||||
};
|
||||
|
||||
IColourImpl* platformColourInstance() {
|
||||
return isatty(STDOUT_FILENO)
|
||||
Ptr<IConfig const> config = getCurrentContext().getConfig();
|
||||
return (config && config->forceColour()) || isatty(STDOUT_FILENO)
|
||||
? PosixColourImpl::instance()
|
||||
: NoColourImpl::instance();
|
||||
}
|
||||
|
Reference in New Issue
Block a user