You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When Catch output is redirected to a file via the --out option and color output is forced via --use-colour=yes, the color escape sequences are written to stdout instead of to the file.
Expected behavior
The color codes are written to the file.
Additional context
I looked inside of the code and the reporters use Colour colour(Colour::ResultSuccess); as scoped colour setting. That calls Colour::use(Colour::Code) -> IColourImpl::use(Colour::Code). PosixColourImpl::setColour then retrieves the stream via Catch::cout(), which is wrong.
IMHO the cleanest solution is that the Colour RAII guard takes the stream, but that requires modifying all the reporters, even external (could be defaulted, but that would keep the code wrong unnoticed).
Alternatively retrieve the stream in setColour via getCurrentContext().getConfig()->stream(), which is much simpler, but I don't know if it could have any side effects.
The text was updated successfully, but these errors were encountered:
Describe the bug
When Catch output is redirected to a file via the
--out
option and color output is forced via--use-colour=yes
, the color escape sequences are written to stdout instead of to the file.Expected behavior
The color codes are written to the file.
Reproduction steps
Platform information:
Additional context
I looked inside of the code and the reporters use
Colour colour(Colour::ResultSuccess);
as scoped colour setting. That callsColour::use(Colour::Code)
->IColourImpl::use(Colour::Code)
.PosixColourImpl::setColour
then retrieves the stream viaCatch::cout()
, which is wrong.IMHO the cleanest solution is that the
Colour
RAII guard takes the stream, but that requires modifying all the reporters, even external (could be defaulted, but that would keep the code wrong unnoticed).Alternatively retrieve the stream in
setColour
viagetCurrentContext().getConfig()->stream()
, which is much simpler, but I don't know if it could have any side effects.The text was updated successfully, but these errors were encountered: