fix parsing the test harness JSON when time could not be measured

This commit is contained in:
Ralf Jung 2024-03-29 19:18:51 +01:00
parent a6803b9de4
commit ecc714d88e

View File

@ -231,14 +231,16 @@ impl<'a> Renderer<'a> {
print!("\ntest result: ");
self.builder.colored_stdout(|stdout| outcome.write_long(stdout)).unwrap();
println!(
". {} passed; {} failed; {} ignored; {} measured; {} filtered out; \
finished in {:.2?}\n",
". {} passed; {} failed; {} ignored; {} measured; {} filtered out{time}\n",
suite.passed,
suite.failed,
suite.ignored,
suite.measured,
suite.filtered_out,
Duration::from_secs_f64(suite.exec_time)
time = match suite.exec_time {
Some(t) => format!("; finished in {:.2?}", Duration::from_secs_f64(t)),
None => format!(""),
}
);
}
@ -374,7 +376,9 @@ struct SuiteOutcome {
ignored: usize,
measured: usize,
filtered_out: usize,
exec_time: f64,
/// The time it took to execute this test suite, or `None` if time measurement was not possible
/// (e.g. due to running inside Miri).
exec_time: Option<f64>,
}
#[derive(serde_derive::Deserialize)]