diff options
author | Chase Qi <chase.qi@linaro.org> | 2016-07-25 12:39:49 +0800 |
---|---|---|
committer | Chase Qi <chase.qi@linaro.org> | 2016-07-25 18:46:38 +0800 |
commit | ada7c84f4cbfd392891b48b281b257ef31a5b36f (patch) | |
tree | a30aca8089a4a0a6416826aa63377971b2451041 /android | |
parent | 74dcae69247c5741921ec8006e2723b39991fa61 (diff) |
android: optee-xtest: added support for result statistics
Change-Id: Ic7e912fb182e7bd5706b882913daa95ae6d9cc3a
Signed-off-by: Chase Qi <chase.qi@linaro.org>
Diffstat (limited to 'android')
-rwxr-xr-x | android/scripts/optee-xtest.sh | 25 |
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 |