mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
libtest: flush output after every write
Useful for debugging tests that hang forever.
This commit is contained in:
parent
41f8b1e89b
commit
c9168cca72
@ -506,16 +506,25 @@ impl<T: Writer> ConsoleTestState<T> {
|
||||
if self.use_color {
|
||||
try!(term.reset());
|
||||
}
|
||||
Ok(())
|
||||
term.flush()
|
||||
}
|
||||
Raw(ref mut stdout) => {
|
||||
try!(stdout.write_all(word.as_bytes()));
|
||||
stdout.flush()
|
||||
}
|
||||
Raw(ref mut stdout) => stdout.write_all(word.as_bytes())
|
||||
}
|
||||
}
|
||||
|
||||
pub fn write_plain(&mut self, s: &str) -> old_io::IoResult<()> {
|
||||
match self.out {
|
||||
Pretty(ref mut term) => term.write_all(s.as_bytes()),
|
||||
Raw(ref mut stdout) => stdout.write_all(s.as_bytes())
|
||||
Pretty(ref mut term) => {
|
||||
try!(term.write_all(s.as_bytes()));
|
||||
term.flush()
|
||||
},
|
||||
Raw(ref mut stdout) => {
|
||||
try!(stdout.write_all(s.as_bytes()));
|
||||
stdout.flush()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user