summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xandroid/scripts/optee-xtest.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/android/scripts/optee-xtest.sh b/android/scripts/optee-xtest.sh
index 4c2cda6..de2226d 100755
--- a/android/scripts/optee-xtest.sh
+++ b/android/scripts/optee-xtest.sh
@@ -73,6 +73,30 @@ benchmark_parser() {
done < "${TEST_SUITE}"_result.txt
}
+stats_parser() {
+ for i in "subtests" "test cases"; do
+ stats=$(egrep "^[0-9]+ $i of which [0-9]+ failed" \
+ "${TEST_SUITE}"_output.txt)
+ total=$(echo "${stats}" | awk '{print $1}')
+ fails=$(echo "${stats}" | awk '{print $(NF-1)}')
+ passes=$(( total - fails ))
+
+ test "$i" = "test cases" && i="tests"
+ lava-test-case "xtest-$i-fails" --result "pass" \
+ --measurement "${fails}" --units "tests"
+ lava-test-case "xtest-$i-passes" --result "pass" \
+ --measurement "${passes}" --units "tests"
+ lava-test-case "xtest-$i-fail-rate" --result "pass" \
+ --measurement "${fails}"/"${total}" --units "percent"
+ done
+
+ skip=$(egrep "^[0-9]+ test case was skipped" \
+ "${TEST_SUITE}"_output.txt | awk '{print $1}')
+ lava-test-case xtest-tests-skipped --result "pass" \
+ --measurement "${skip}" --units "tests"
+
+}
+
# Run xtest
xtest -l "${LEVEL}" -t "${TEST_SUITE}" 2>&1 | tee "${TEST_SUITE}"_output.txt
if [ $? -eq 0 ]; then
@@ -82,6 +106,7 @@ else
fi
# Parse test result.
+stats_parser
if [ "${TEST_SUITE}" = "regression" ]; then
pass_fail_parser 3
elif [ "${TEST_SUITE}" = "benchmark" ]; then