diff --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py --- a/libcxx/utils/libcxx/test/config.py +++ b/libcxx/utils/libcxx/test/config.py @@ -159,7 +159,6 @@ self.lit_config.note("Running against the C++ Library at {}".format(self.cxx_runtime_root)) self.lit_config.note("Linking against the ABI Library at {}".format(self.abi_library_root)) self.lit_config.note("Running against the ABI Library at {}".format(self.abi_runtime_root)) - sys.stderr.flush() # Force flushing to avoid broken output on Windows def get_test_format(self): from libcxx.test.format import LibcxxTestFormat diff --git a/llvm/utils/lit/lit/LitConfig.py b/llvm/utils/lit/lit/LitConfig.py --- a/llvm/utils/lit/lit/LitConfig.py +++ b/llvm/utils/lit/lit/LitConfig.py @@ -169,6 +169,11 @@ line = inspect.getlineno(f) sys.stderr.write('%s: %s:%d: %s: %s\n' % (self.progname, file, line, kind, message)) + if self.isWindows: + # In a git bash terminal, the writes to sys.stderr aren't visible + # on screen immediately. Flush them here to avoid broken/misoredered + # output. + sys.stderr.flush() def note(self, message): if not self.quiet: