olegantonyan / googletest

Automatically exported from code.google.com/p/googletest. Added qmake build
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Bold colors in terminal output on Linux #271

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
From user's email 
(http://groups.google.com/group/googletestframework/browse_thread/thread/35b3572
67570de0
3/631d8ee66b68a8e2#631d8ee66b68a8e2):

 Gtest for Windows prints the colored text in bold font which makes it stand out. Gtest for Linux 
prints the colored text in normal font which makes it hard to read. I would 
like to see Linux print 
bold colors also. 
To change Linux colors to bold, only one thing needs to be changed. In 
gtest.cc, line 2624 (version 
1.4.0), change 0 to 1 as follows: 
  From: 
printf("\033[0;3%sm", GetAnsiColorCode(color)); 
  To: 
printf("\033[1;3%sm", GetAnsiColorCode(color)); 

Original issue reported on code.google.com by vladlosev on 1 Apr 2010 at 1:36

GoogleCodeExporter commented 9 years ago
I'm not sure about this change.  The current color scheme was carefully chosen 
to please most people.  No single scheme will be able to satisfy all people.  
If we make the change, we'll please some and upset some.  I think it's better 
to keep the default unchanged and lets people customize in some way.

One way to customize is to replace gtest's text output with a custom event 
listener, which can be done through gtest's public API.  Another way is to pipe 
gtest's output through a small program that translates the ANSI color code, e.g.

  foo_test --gtest_color=yes | bold

where bold is the program the user needs to write, which should be easy.

Original comment by w...@google.com on 8 Sep 2010 at 6:27