Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting color_output=no does not disable the output of color format codes #149

Closed
Markus87 opened this issue Aug 21, 2018 · 4 comments
Closed

Comments

@Markus87
Copy link

I think --color_output=no should not just use the default color for everything, it should stop color format codes from being outputted completely. The current behaviour is very misleading to me.

is_color_output ? utils::attr : utils::term_attr::NORMAL, \

To understand why it is a problem let me describe my test setup:
I use ctest to run boost tests and instructed ctest to output everything to a file.
The file contains all color codes that boost writes, --color_output=yes/no only changes if its all the same color or not, the codes remain any way.

@toonetown
Copy link
Contributor

Agreed. This also happens when trying to run unit tests within Xcode's debugger windows (which doesn't support ANSI colors).

I was able to work around it (in my particular case) by tweaking the #define BOOST_TEST_SCOPE_SETCOLOR. I added these lines before including my main unit test headers:

#include <boost/test/utils/setcolor.hpp>
#undef BOOST_TEST_SCOPE_SETCOLOR
#define BOOST_TEST_SCOPE_SETCOLOR(is_color_output, os, attr, color)

That basically just disables ansi color altogether.

@toonetown
Copy link
Contributor

IMO, I think that if you say --enable_color=no, it should completely skip the ansi codes altogether.

@toonetown
Copy link
Contributor

A proposed patch can be found at #154

@raffienficiaud
Copy link
Member

Closed through PR #154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants