commit fdf51cc
shrub
·
2026-05-14 20:37:09 +0000 UTC
parent fa3993a
add pass percentage to the runner
1 files changed,
+5,
-1
+5,
-1
1@@ -186,6 +186,10 @@ func printsummaryline(label string, summaries []categorysummary) {
2 }
3 failedcases := totalcases - totalpassed
4 failedcategories := len(summaries) - passedcategories
5+ passrate := 0.0
6+ if totalcases > 0 {
7+ passrate = 100.0 * float64(totalpassed) / float64(totalcases)
8+ }
9
10 fmt.Printf("%s: %d/%d tests passed", label, totalpassed, totalcases)
11 if failedcases > 0 {
12@@ -196,7 +200,7 @@ func printsummaryline(label string, summaries []categorysummary) {
13 } else {
14 fmt.Print("ies affected")
15 }
16- fmt.Println(") :(")
17+ fmt.Printf(", pass rate %.1f%%) :(\n", passrate)
18 return
19 }
20