Skip to content

Commit

Permalink
WPT: print pass percentage
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoburns committed Nov 5, 2024
1 parent 8a832e9 commit 2a9c9d3
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions apps/wpt/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,24 @@ fn main() {
},
);

let pass_count = pass_count.load(Ordering::SeqCst);
let fail_count = fail_count.load(Ordering::SeqCst);
let crash_count = crash_count.load(Ordering::SeqCst);
let skip_count = skip_count.load(Ordering::SeqCst);

let run_count = pass_count + fail_count + crash_count;

println!("---");
println!("Done in {}s", (Instant::now() - start).as_secs());
println!("{} tests PASSED.", pass_count.load(Ordering::SeqCst));
println!("{} tests FAILED.", fail_count.load(Ordering::SeqCst));
println!("{} tests CRASHED.", crash_count.load(Ordering::SeqCst));
println!("{} tests SKIPPED.", skip_count.load(Ordering::SeqCst));
println!("{pass_count} tests PASSED.");
println!("{fail_count} tests FAILED.");
println!("{crash_count} tests CRASHED.");
println!("{skip_count} tests SKIPPED.");
println!("---");
let pessimistic_percent = (pass_count as f32 / count as f32) * 100.0;
let optimistic_percent = (pass_count as f32 / run_count as f32) * 100.0;
println!("Percent of total: {pessimistic_percent:.2}%");
println!("Percent of run: {optimistic_percent:.2}%");
}

async fn serve(app: Router, port: u16) {
Expand Down

0 comments on commit 2a9c9d3

Please sign in to comment.