Commit 482ac6ee by Abseil Team Committed by vslashg

Googletest export

Move internal function out of header because Hyrum's law always wins. PiperOrigin-RevId: 301446904
parent c43f7100
...@@ -1807,12 +1807,6 @@ class GTEST_API_ AssertHelper { ...@@ -1807,12 +1807,6 @@ class GTEST_API_ AssertHelper {
GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper); GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
}; };
enum class GTestColor { kDefault, kRed, kGreen, kYellow };
GTEST_API_ GTEST_ATTRIBUTE_PRINTF_(2, 3) void ColoredPrintf(GTestColor color,
const char* fmt,
...);
} // namespace internal } // namespace internal
// The pure interface class that all value-parameterized tests inherit from. // The pure interface class that all value-parameterized tests inherit from.
......
...@@ -3056,6 +3056,9 @@ static const char * TestPartResultTypeToString(TestPartResult::Type type) { ...@@ -3056,6 +3056,9 @@ static const char * TestPartResultTypeToString(TestPartResult::Type type) {
} }
namespace internal { namespace internal {
namespace {
enum class GTestColor { kDefault, kRed, kGreen, kYellow };
} // namespace
// Prints a TestPartResult to an std::string. // Prints a TestPartResult to an std::string.
static std::string PrintTestPartResultToString( static std::string PrintTestPartResultToString(
...@@ -3194,6 +3197,7 @@ bool ShouldUseColor(bool stdout_is_tty) { ...@@ -3194,6 +3197,7 @@ bool ShouldUseColor(bool stdout_is_tty) {
// cannot simply emit special characters and have the terminal change colors. // cannot simply emit special characters and have the terminal change colors.
// This routine must actually emit the characters rather than return a string // This routine must actually emit the characters rather than return a string
// that would be colored when printed, as can be done on Linux. // that would be colored when printed, as can be done on Linux.
void ColoredPrintf(GTestColor color, const char* fmt, ...) { void ColoredPrintf(GTestColor color, const char* fmt, ...) {
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment