GNU screen (http://www.gnu.org/software/screen/) sets TERM to "screen",
then gtest does not use colors since it does not know "screen".
The following is my patch. I confirmed that it is working.
Index: test/gtest_unittest.cc
===================================================================
--- test/gtest_unittest.cc (revision 415)
+++ test/gtest_unittest.cc (working copy)
@@ -6264,6 +6264,9 @@
SetEnv("TERM", "xterm-color"); // TERM supports colors.
EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
+ SetEnv("TERM", "screen"); // TERM supports colors.
+ EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
+
SetEnv("TERM", "linux"); // TERM supports colors.
EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
#endif // GTEST_OS_WINDOWS
Index: src/gtest.cc
===================================================================
--- src/gtest.cc (revision 415)
+++ src/gtest.cc (working copy)
@@ -2592,6 +2592,7 @@
String::CStringEquals(term, "xterm") ||
String::CStringEquals(term, "xterm-color") ||
String::CStringEquals(term, "xterm-256color") ||
+ String::CStringEquals(term, "screen") ||
String::CStringEquals(term, "linux") ||
String::CStringEquals(term, "cygwin");
return stdout_is_tty && term_supports_color;
Original issue reported on code.google.com by eun...@gmail.com on 14 Apr 2010 at 7:56
Original issue reported on code.google.com by
eun...@gmail.com
on 14 Apr 2010 at 7:56