use dev_flaky::{FlakyError, FlakyRun};
fn main() {
let run = FlakyRun::new("example", "0.1.0").iterations(5);
let result = match run.execute() {
Ok(r) => r,
Err(FlakyError::ToolNotInstalled) => {
eprintln!("cargo is not on PATH; skipping example.");
return;
}
Err(e) => {
eprintln!("flaky run failed: {e}");
return;
}
};
println!(
"iterations completed: {}, total tests observed: {}, flaky: {}, broken: {}",
result.iterations,
result.total_count(),
result.flaky_count(),
result.broken_count()
);
let report = result.into_report();
println!("{}", report.to_json().expect("serialize report"));
}