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
4b7f9453
Commit
4b7f9453
authored
Nov 10, 2022
by
Denis Hananein
Browse files
Support kitty TERM
Signed-off-by:
Denis Hananein
<
i@zloylos.me
>
parent
e07617d6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
0 deletions
+5
-0
googletest/src/gtest.cc
googletest/src/gtest.cc
+1
-0
googletest/test/googletest-color-test.py
googletest/test/googletest-color-test.py
+1
-0
googletest/test/gtest_unittest.cc
googletest/test/gtest_unittest.cc
+3
-0
No files found.
googletest/src/gtest.cc
View file @
4b7f9453
...
@@ -3257,6 +3257,7 @@ bool ShouldUseColor(bool stdout_is_tty) {
...
@@ -3257,6 +3257,7 @@ bool ShouldUseColor(bool stdout_is_tty) {
const
bool
term_supports_color
=
term
!=
nullptr
&&
(
const
bool
term_supports_color
=
term
!=
nullptr
&&
(
String
::
CStringEquals
(
term
,
"xterm"
)
||
String
::
CStringEquals
(
term
,
"xterm"
)
||
String
::
CStringEquals
(
term
,
"xterm-color"
)
||
String
::
CStringEquals
(
term
,
"xterm-color"
)
||
String
::
CStringEquals
(
term
,
"xterm-kitty"
)
||
String
::
CStringEquals
(
term
,
"screen"
)
||
String
::
CStringEquals
(
term
,
"screen"
)
||
String
::
CStringEquals
(
term
,
"tmux"
)
||
String
::
CStringEquals
(
term
,
"tmux"
)
||
String
::
CStringEquals
(
term
,
"rxvt-unicode"
)
||
String
::
CStringEquals
(
term
,
"rxvt-unicode"
)
||
...
...
googletest/test/googletest-color-test.py
View file @
4b7f9453
...
@@ -78,6 +78,7 @@ class GTestColorTest(gtest_test_utils.TestCase):
...
@@ -78,6 +78,7 @@ class GTestColorTest(gtest_test_utils.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-kitty'
,
None
,
None
))
self
.
assert_
(
UsesColor
(
'xterm-256color'
,
None
,
None
))
self
.
assert_
(
UsesColor
(
'xterm-256color'
,
None
,
None
))
def
testFlagOnly
(
self
):
def
testFlagOnly
(
self
):
...
...
googletest/test/gtest_unittest.cc
View file @
4b7f9453
...
@@ -6636,6 +6636,9 @@ TEST(ColoredOutputTest, UsesColorsWhenTermSupportsColors) {
...
@@ -6636,6 +6636,9 @@ TEST(ColoredOutputTest, UsesColorsWhenTermSupportsColors) {
SetEnv
(
"TERM"
,
"xterm-color"
);
// TERM supports colors.
SetEnv
(
"TERM"
,
"xterm-color"
);
// TERM supports colors.
EXPECT_TRUE
(
ShouldUseColor
(
true
));
// Stdout is a TTY.
EXPECT_TRUE
(
ShouldUseColor
(
true
));
// Stdout is a TTY.
SetEnv
(
"TERM"
,
"xterm-kitty"
);
// TERM supports colors.
EXPECT_TRUE
(
ShouldUseColor
(
true
));
// Stdout is a TTY.
SetEnv
(
"TERM"
,
"xterm-256color"
);
// TERM supports colors.
SetEnv
(
"TERM"
,
"xterm-256color"
);
// TERM supports colors.
EXPECT_TRUE
(
ShouldUseColor
(
true
));
// Stdout is a TTY.
EXPECT_TRUE
(
ShouldUseColor
(
true
));
// Stdout is a TTY.
...
...
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