summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Siemsen <ralph.siemsen@linaro.org>2021-05-17 12:17:02 -0400
committerRalph Siemsen <ralph.siemsen@linaro.org>2021-05-17 12:30:05 -0400
commitb8b1724ce08a392e76d80e604fd51adb7633ba87 (patch)
tree97ec49bac438478bfb48759be35833c0028a4379
parent49e12383fddd91ce7615e22eca7dcb3086964568 (diff)
rfs-do-sums: recompute pass/fail/skip counts
Small helper script to recompute the pass/fail/skip totals. Useful after having hand-modified the test results, such as for dropping the LTP tests. Note this does not modify the HTML, it only prints out the revised counts to stdout. They need to be reinserted manually. Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
-rwxr-xr-xexamples/rfs-do-sums32
1 files changed, 32 insertions, 0 deletions
diff --git a/examples/rfs-do-sums b/examples/rfs-do-sums
new file mode 100755
index 0000000..30df7b4
--- /dev/null
+++ b/examples/rfs-do-sums
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# Read in HTML, recompute the pass/fail/xfail/skip values,
+# and the totals.
+#
+# !!! WARNING !!!
+# Script assumes that soca9 test runs comes before rzn1.
+
+FILE=$1
+
+SOCA9_PASS=$(sed -n '/<h3>soca9/,/<h3>rzn1/ p' $FILE | egrep '>pass<' | wc -l)
+SOCA9_FAIL=$(sed -n '/<h3>soca9/,/<h3>rzn1/ p' $FILE | egrep '>fail<' | wc -l)
+SOCA9_XFAIL=$(sed -n '/<h3>soca9/,/<h3>rzn1/ p' $FILE | egrep '>xfail<' | wc -l)
+SOCA9_SKIP=$(sed -n '/<h3>soca9/,/<h3>rzn1/ p' $FILE | egrep '>skip<' | wc -l)
+
+RZN1D_PASS=$(sed -n '/<h3>rzn1/,$ p' $FILE | egrep '>pass<' | wc -l)
+RZN1D_FAIL=$(sed -n '/<h3>rzn1/,$ p' $FILE | egrep '>fail<' | wc -l)
+RZN1D_XFAIL=$(sed -n '/<h3>rzn1/,$ p' $FILE | egrep '>xfail<' | wc -l)
+RZN1D_SKIP=$(sed -n '/<h3>rzn1/,$ p' $FILE | egrep '>skip<' | wc -l)
+
+TOTAL_PASS=$((SOCA9_PASS + RZN1D_PASS))
+TOTAL_FAIL=$((SOCA9_FAIL + RZN1D_FAIL))
+TOTAL_XFAIL=$((SOCA9_XFAIL + RZN1D_XFAIL))
+TOTAL_SKIP=$((SOCA9_SKIP + RZN1D_SKIP))
+
+TOTAL_TESTS=$((TOTAL_PASS + TOTAL_FAIL + TOTAL_XFAIL + TOTAL_SKIP))
+
+printf "\tPASS\tFAIL\tXFAIL\tSKIP\n"
+printf "soca9\t%d\t%d\t%d\t%d\n" $SOCA9_PASS $SOCA9_FAIL $SOCA9_XFAIL $SOCA9_SKIP
+printf "rzn1d\t%d\t%d\t%d\t%d\n" $RZN1D_PASS $RZN1D_FAIL $RZN1D_XFAIL $RZN1D_SKIP
+printf "TOTAL\t%d\t%d\t%d\t%d\n" $TOTAL_PASS $TOTAL_FAIL $TOTAL_XFAIL $TOTAL_SKIP
+printf "%d\n" $TOTAL_TESTS