mirror of
https://github.com/rust-lang/rust
synced 2024-09-05 16:57:03 +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 @@ pub fn write_pretty(&mut self,
|
|||
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 a new issue