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
e0548960
Commit
e0548960
authored
Apr 22, 2010
by
vladlosev
Browse files
Implements color output in GNU Screen sessions (issue 277).
parent
e8537560
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
src/gtest.cc
src/gtest.cc
+1
-0
test/gtest_unittest.cc
test/gtest_unittest.cc
+9
-0
No files found.
src/gtest.cc
View file @
e0548960
...
...
@@ -2592,6 +2592,7 @@ bool ShouldUseColor(bool stdout_is_tty) {
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
;
...
...
test/gtest_unittest.cc
View file @
e0548960
...
...
@@ -6264,8 +6264,17 @@ TEST(ColoredOutputTest, UsesColorsWhenTermSupportsColors) {
SetEnv
(
"TERM"
,
"xterm-color"
);
// TERM supports colors.
EXPECT_TRUE
(
ShouldUseColor
(
true
));
// Stdout is a TTY.
SetEnv
(
"TERM"
,
"xterm-256color"
);
// 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.
SetEnv
(
"TERM"
,
"cygwin"
);
// TERM supports colors.
EXPECT_TRUE
(
ShouldUseColor
(
true
));
// Stdout is a TTY.
#endif // GTEST_OS_WINDOWS
}
...
...
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