Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
fd36c200
Commit
fd36c200
authored
Jun 09, 2009
by
zhanyong.wan
Browse files
Adds support for xterm-256color (by Michihiro Kuramochi).
parent
1bd424d9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
src/gtest.cc
src/gtest.cc
+2
-1
test/gtest_color_test.py
test/gtest_color_test.py
+1
-0
No files found.
src/gtest.cc
View file @
fd36c200
...
@@ -183,7 +183,7 @@ GTEST_DEFINE_string_(
...
@@ -183,7 +183,7 @@ GTEST_DEFINE_string_(
"Whether to use colors in the output. Valid values: yes, no, "
"Whether to use colors in the output. Valid values: yes, no, "
"and auto. 'auto' means to use colors if the output is "
"and auto. 'auto' means to use colors if the output is "
"being sent to a terminal and the TERM environment variable "
"being sent to a terminal and the TERM environment variable "
"is set to xterm
or xterm-color."
);
"is set to xterm
, xterm-col
or
,
xterm-
256
color
or cygwin
."
);
GTEST_DEFINE_string_
(
GTEST_DEFINE_string_
(
filter
,
filter
,
...
@@ -2518,6 +2518,7 @@ bool ShouldUseColor(bool stdout_is_tty) {
...
@@ -2518,6 +2518,7 @@ bool ShouldUseColor(bool stdout_is_tty) {
const
bool
term_supports_color
=
const
bool
term_supports_color
=
String
::
CStringEquals
(
term
,
"xterm"
)
||
String
::
CStringEquals
(
term
,
"xterm"
)
||
String
::
CStringEquals
(
term
,
"xterm-color"
)
||
String
::
CStringEquals
(
term
,
"xterm-color"
)
||
String
::
CStringEquals
(
term
,
"xterm-256color"
)
||
String
::
CStringEquals
(
term
,
"cygwin"
);
String
::
CStringEquals
(
term
,
"cygwin"
);
return
stdout_is_tty
&&
term_supports_color
;
return
stdout_is_tty
&&
term_supports_color
;
#endif // GTEST_OS_WINDOWS
#endif // GTEST_OS_WINDOWS
...
...
test/gtest_color_test.py
View file @
fd36c200
...
@@ -78,6 +78,7 @@ class GTestColorTest(unittest.TestCase):
...
@@ -78,6 +78,7 @@ class GTestColorTest(unittest.TestCase):
self
.
assert_
(
UsesColor
(
'cygwin'
,
None
,
None
))
self
.
assert_
(
UsesColor
(
'cygwin'
,
None
,
None
))
self
.
assert_
(
UsesColor
(
'xterm'
,
None
,
None
))
self
.
assert_
(
UsesColor
(
'xterm'
,
None
,
None
))
self
.
assert_
(
UsesColor
(
'xterm-color'
,
None
,
None
))
self
.
assert_
(
UsesColor
(
'xterm-color'
,
None
,
None
))
self
.
assert_
(
UsesColor
(
'xterm-256color'
,
None
,
None
))
def
testFlagOnly
(
self
):
def
testFlagOnly
(
self
):
"""Tests the case when there's --gtest_color but not GTEST_COLOR."""
"""Tests the case when there's --gtest_color but not GTEST_COLOR."""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment