From a7fcd091d472d10de0bdb40e76e0d18d519f7f7f Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sun, 2 Jul 2017 00:14:42 +0200 Subject: [PATCH] tests: better summary --- tests/integration-tests.sh | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/tests/integration-tests.sh b/tests/integration-tests.sh index f6582874d..3c09afc5d 100755 --- a/tests/integration-tests.sh +++ b/tests/integration-tests.sh @@ -70,8 +70,10 @@ TESTS=${SRCDIR}/tests/integration/${FILTER}.sh # Preperations mkdir -p ${LOGDIR} -NUM_PASS=0 -NUM_FAIL=0 +PASSED=0 +FAILED=0 +SKIPPED=0 +TIMEDOUT=0 # Preamble echo -e "Starting integration tests for VILLASnode/fpga:\n" @@ -90,25 +92,31 @@ for TEST in ${TESTS}; do case $RC in 0) echo -e "\e[32m[Pass] \e[39m ${TESTNAME}" - NUM_PASS=$((${NUM_PASS} + 1)) + PASSED=$((${PASSED} + 1)) ;; 99) echo -e "\e[93m[Skip] \e[39m ${TESTNAME}" - NUM_SKIP=$((${NUM_SKIP} + 1)) + SKIPPED=$((${SKIPPED} + 1)) ;; 124) - echo -e "\e[31m[Timeout] \e[39m ${TESTNAME}" + echo -e "\e[33m[Time] \e[39m ${TESTNAME}" + TIMEDOUT=$((${TIMEDOUT} + 1)) + FAILED=$((${FAILED} + 1)) ;; *) echo -e "\e[31m[Fail] \e[39m ${TESTNAME} with code $RC" - NUM_FAIL=$((${NUM_FAIL} + 1)) + FAILED=$((${FAILED} + 1)) ;; esac + + TOTAL=$((${TOTAL} + 1)) done # Show summary -if (( ${NUM_FAIL} > 0 )); then - echo -e "\nSummary: ${NUM_FAIL} of $((${NUM_FAIL} + ${NUM_PASS})) tests failed." +if (( ${FAILED} > 0 )); then + echo -e "\nSummary: ${FAILED} of ${TOTAL} tests failed." + echo -e " Timedout: ${TIMEDOUT}" + echo -e " Skipped: ${SKIPPED}" exit 1 else echo -e "\nSummary: all tests passed!"