mirror of
https://github.com/rust-lang/rust
synced 2024-09-19 16:32:34 +00:00
Cleanup write_run_finish().
This commit is contained in:
parent
5d2056a7e3
commit
27b3e14d7f
|
@ -624,34 +624,14 @@ pub fn write_failures(&mut self) -> io::IoResult<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub fn write_run_finish(&mut self,
|
||||
ratchet_metrics: &Option<Path>,
|
||||
ratchet_pct: Option<f64>) -> io::IoResult<bool> {
|
||||
pub fn write_run_finish(&mut self) -> io::IoResult<bool> {
|
||||
assert!(self.passed + self.failed + self.ignored + self.measured == self.total);
|
||||
|
||||
let ratchet_success = match *ratchet_metrics {
|
||||
None => true,
|
||||
Some(ref pth) => {
|
||||
try!(self.write_plain(format!("\nusing metrics ratchet: {:?}\n",
|
||||
pth.display()).as_slice()));
|
||||
match ratchet_pct {
|
||||
None => (),
|
||||
Some(pct) =>
|
||||
try!(self.write_plain(format!("with noise-tolerance \
|
||||
forced to: {}%\n",
|
||||
pct).as_slice()))
|
||||
}
|
||||
true
|
||||
}
|
||||
};
|
||||
|
||||
let test_success = self.failed == 0u;
|
||||
if !test_success {
|
||||
let success = self.failed == 0u;
|
||||
if !success {
|
||||
try!(self.write_failures());
|
||||
}
|
||||
|
||||
let success = ratchet_success && test_success;
|
||||
|
||||
try!(self.write_plain("\ntest result: "));
|
||||
if success {
|
||||
// There's no parallelism at this point so it's safe to use color
|
||||
|
@ -745,7 +725,7 @@ fn len_if_padded(t: &TestDescAndFn) -> uint {
|
|||
None => {}
|
||||
}
|
||||
try!(run_tests(opts, tests, |x| callback(&x, &mut st)));
|
||||
return st.write_run_finish(&None, None);
|
||||
return st.write_run_finish();
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Reference in a new issue