From fd36c200f446aaada1a1f0b026f2d742d4b2fa5a Mon Sep 17 00:00:00 2001 From: "zhanyong.wan" Date: Tue, 9 Jun 2009 05:38:14 +0000 Subject: [PATCH] Adds support for xterm-256color (by Michihiro Kuramochi). --- src/gtest.cc | 3 ++- test/gtest_color_test.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gtest.cc b/src/gtest.cc index 6fc4044d..c093bce9 100644 --- a/src/gtest.cc +++ b/src/gtest.cc @@ -183,7 +183,7 @@ GTEST_DEFINE_string_( "Whether to use colors in the output. Valid values: yes, no, " "and auto. 'auto' means to use colors if the output is " "being sent to a terminal and the TERM environment variable " - "is set to xterm or xterm-color."); + "is set to xterm, xterm-color, xterm-256color or cygwin."); GTEST_DEFINE_string_( filter, @@ -2518,6 +2518,7 @@ bool ShouldUseColor(bool stdout_is_tty) { const bool term_supports_color = String::CStringEquals(term, "xterm") || String::CStringEquals(term, "xterm-color") || + String::CStringEquals(term, "xterm-256color") || String::CStringEquals(term, "cygwin"); return stdout_is_tty && term_supports_color; #endif // GTEST_OS_WINDOWS diff --git a/test/gtest_color_test.py b/test/gtest_color_test.py index 32db4b9a..1b686304 100755 --- a/test/gtest_color_test.py +++ b/test/gtest_color_test.py @@ -78,6 +78,7 @@ class GTestColorTest(unittest.TestCase): self.assert_(UsesColor('cygwin', None, None)) self.assert_(UsesColor('xterm', None, None)) self.assert_(UsesColor('xterm-color', None, None)) + self.assert_(UsesColor('xterm-256color', None, None)) def testFlagOnly(self): """Tests the case when there's --gtest_color but not GTEST_COLOR."""