Files
Bruno_Tests/parse_stats.awk
2026-08-31 21:20:10 +03:00

34 lines
934 B
Awk
Executable File

BEGIN {
total = 0
passed = 0
failed = 0
}
/^┌───────────────┬──────────────────────────┐$/ {
in_table = 1
next
}
in_table && /^│ Requests[[:space:]]+│/ {
if (match($0, /[0-9]+ \([0-9]+ Passed, [0-9]+ Failed\)/)) {
s = substr($0, RSTART, RLENGTH)
gsub(/[()]/, "", s)
split(s, parts, /[[:space:],]+/)
total = parts[1]
passed = parts[2]
failed = parts[4]
in_table = 0
}
}
in_table && /^└───────────────┴──────────────────────────┘$/ {
in_table = 0
}
END {
if (total == 0) {
print "WARNING: Could not parse stats from logs.txt" > "/dev/stderr"
}
printf "Total=%d, Passed=%d, Failed=%d\n", total, passed, failed
}