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

Comments

Projects
None yet
3 participants
@Markus87

Markus87 commented Aug 21, 2018

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

This comment has been minimized.

Contributor

toonetown commented Aug 30, 2018

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

This comment has been minimized.

Contributor

toonetown commented Aug 30, 2018

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

@toonetown

This comment has been minimized.

Contributor

toonetown commented Aug 30, 2018

A proposed patch can be found at #154

@raffienficiaud

This comment has been minimized.

Member

raffienficiaud commented Sep 3, 2018

Closed through PR #154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment