summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClark Laughlin <clark.laughlin@linaro.org>2015-05-08 13:15:32 -0400
committerClark Laughlin <clark.laughlin@linaro.org>2015-05-08 13:15:32 -0400
commit4ffd16325ad2fd3c313bd4f2e1304d3b41cb0f96 (patch)
tree9e0b83dd9afd1ece4078add4a86203f2ba389a50
parent1bce9c87e2f6f269f64a6c3435f6a704d7c64047 (diff)
parse-subunit-stream: initial version
simple script to parse a subunit stream and extract individual CSV files containing failed, passing, skipped, etc tests
-rwxr-xr-xsubunit/parse-subunit-stream25
1 files changed, 25 insertions, 0 deletions
diff --git a/subunit/parse-subunit-stream b/subunit/parse-subunit-stream
new file mode 100755
index 0000000..5afe58e
--- /dev/null
+++ b/subunit/parse-subunit-stream
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+SUBUNIT=${1}
+ALL_TESTS=${2}
+
+if [ ! -e "${SUBUNIT}" ] ; then
+ echo "Subunit stream not found: ${SUBUNIT}"
+ exit 1
+fi
+
+TEMP_DIR=$(cat /proc/sys/kernel/random/uuid)
+
+rm -rf ${TEMP_DIR}
+mkdir ${TEMP_DIR}
+
+# generate CSV files containing lists of all tests that were RUN, all FAILED tests, all SKIPPED tests, and all PASSING tests
+cat ${SUBUNIT} | subunit2csv --no-passthrough > ${TEMP_DIR}/run.csv
+cat ${SUBUNIT} | subunit-filter --only-genuine-failures | subunit2csv --no-passthrough > ${TEMP_DIR}/failed.csv
+cat ${SUBUNIT} | subunit-filter --only-genuine-failures --passthrough | subunit2junitxml > ${TEMP_DIR}/failed.xml
+cat ${SUBUNIT} | subunit-filter --no-error --no-failure --no-success --no-xfail | subunit2csv --no-passthrough > ${TEMP_DIR}/skipped.csv
+cat ${SUBUNIT} | subunit-filter --no-skip --no-failure --success | subunit2csv --no-passthrough > ${TEMP_DIR}/passing.csv
+if [ -e "${ALL_TESTS}" ] ; then
+ cp ${ALL_TESTS} ${TEMP_DIR}/all.txt
+fi
+echo "Results have been stored in [${TEMP_DIR}]"