aboutsummaryrefslogtreecommitdiffstats
path: root/src/gtest.cc
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2010-01-27 22:27:30 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2010-01-27 22:27:30 +0000
commitfd6f2a8a4b3fe8beb31f26b774b460727c410b66 (patch)
tree3425e1293b03fd10bf46272484c6abc2753308ae /src/gtest.cc
parent27a65a9d67db865e9fba8224780fd2b7a71fe7d1 (diff)
downloadgoogletest-fd6f2a8a4b3fe8beb31f26b774b460727c410b66.tar.gz
googletest-fd6f2a8a4b3fe8beb31f26b774b460727c410b66.tar.bz2
googletest-fd6f2a8a4b3fe8beb31f26b774b460727c410b66.zip
Implements stdout capturing (by Vlad Losev); fixes compiler error on NVCC (by Zhanyong Wan).
Diffstat (limited to 'src/gtest.cc')
-rw-r--r--src/gtest.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gtest.cc b/src/gtest.cc
index 11ce571b..f5de645b 100644
--- a/src/gtest.cc
+++ b/src/gtest.cc
@@ -2634,6 +2634,9 @@ void ColoredPrintf(GTestColor color, const char* fmt, ...) {
SetConsoleTextAttribute(stdout_handle,
GetColorAttribute(color) | FOREGROUND_INTENSITY);
vprintf(fmt, args);
+ // Unless we flush stream buffers now the next SetConsoleTextAttribute
+ // call can reset the color before the output reaches the console.
+ fflush(stdout);
// Restores the text color.
SetConsoleTextAttribute(stdout_handle, old_color_attrs);