3 # Merge multiple ZTS tests results summaries into a single summary. This is
4 # needed when you're running different parts of ZTS on different tests
9 # ./merge_summary.awk summary1.txt [summary2.txt] [summary3.txt] ...
13 # cat summary*.txt | ./merge_summary.awk
26 # Total seconds of tests runtime
33 # Skip Configuration and Test lines
34 /^Test
:/{state=
""; next}
35 /Configuration
/{state=
"";next}
37 # When we see "test-runner.py" stop saving config lines, and
38 # save test runner lines
39 /test
-runner.py
/{state=
"testrunner"; runner=runner$
0"\n"; next}
41 # We need to differentiate the PASS counts from test result lines that start
46 # Use state="pass_count" to differentiate
48 /Results Summary
/{state=
"pass_count"; next}
49 /PASS
/{ if (state==
"pass_count") {pass
+= $
2}}
50 /FAIL
/{ if (state==
"pass_count") {fail
+= $
2}}
51 /SKIP
/{ if (state==
"pass_count") {skip
+= $
2}}
56 total
+= arr
[1] * 60 * 60;
62 /Tests with results other than PASS that are expected
/{state=
"expected_lines"; next}
63 /Tests with result of PASS that are unexpected
/{state=
"unexpected_pass_lines"; next}
64 /Tests with results other than PASS that are unexpected
/{state=
"unexpected_lines"; next}
66 if (state ==
"expected_lines") {
67 expected_lines
[el
] = $
0
71 if (state ==
"unexpected_pass_lines") {
72 unexpected_pass_lines
[upl
] = $
0
75 if (state ==
"unexpected_lines") {
76 unexpected_lines
[ul
] = $
0
84 print "\nResults Summary"
89 print "Running Time:\t"strftime
("%T", total
, 1)
90 if (pass
+fail
+skip
> 0) {
91 percent_passed=
(pass
/(pass
+fail
+skip
) * 100)
93 printf "Percent passed:\t%3.2f%", percent_passed
95 print "\n\nTests with results other than PASS that are expected
:"
96 asort(expected_lines, sorted)
100 print "\n\nTests with result of PASS that are unexpected
:"
101 asort(unexpected_pass_lines, sorted)
105 print "\n\nTests with results other than PASS that are unexpected
:"
106 asort(unexpected_lines, sorted)