mirror of
https://github.com/google/googletest.git
synced 2025-12-06 16:57:00 +08:00
Merge pull request #4694 from chromy:main
PiperOrigin-RevId: 775667059 Change-Id: I07edd44ae368ae640d7b985800ffee8cc663c07f
This commit is contained in:
commit
a45468c0fc
@ -3305,6 +3305,7 @@ bool ShouldUseColor(bool stdout_is_tty) {
|
||||
const bool term_supports_color =
|
||||
term != nullptr && (String::CStringEquals(term, "xterm") ||
|
||||
String::CStringEquals(term, "xterm-color") ||
|
||||
String::CStringEquals(term, "xterm-ghostty") ||
|
||||
String::CStringEquals(term, "xterm-kitty") ||
|
||||
String::CStringEquals(term, "alacritty") ||
|
||||
String::CStringEquals(term, "screen") ||
|
||||
|
||||
@ -79,6 +79,7 @@ class GTestColorTest(gtest_test_utils.TestCase):
|
||||
self.assertTrue(UsesColor('cygwin', None, None))
|
||||
self.assertTrue(UsesColor('xterm', None, None))
|
||||
self.assertTrue(UsesColor('xterm-color', None, None))
|
||||
self.assertTrue(UsesColor('xterm-ghostty', None, None))
|
||||
self.assertTrue(UsesColor('xterm-kitty', None, None))
|
||||
self.assertTrue(UsesColor('alacritty', None, None))
|
||||
self.assertTrue(UsesColor('xterm-256color', None, None))
|
||||
|
||||
@ -6717,6 +6717,9 @@ TEST(ColoredOutputTest, UsesColorsWhenTermSupportsColors) {
|
||||
SetEnv("TERM", "xterm-color"); // TERM supports colors.
|
||||
EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
|
||||
|
||||
SetEnv("TERM", "xterm-ghostty"); // TERM supports colors.
|
||||
EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
|
||||
|
||||
SetEnv("TERM", "xterm-kitty"); // TERM supports colors.
|
||||
EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user