From 61eb669f0c2bbef82eba3f19aac28a0b01e473dc Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Wed, 26 Jun 2019 20:37:47 +0200 Subject: [PATCH] tests: show elapsed time per test case --- tools/integration-tests.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/integration-tests.sh b/tools/integration-tests.sh index 2db8bfc30..f2b984437 100755 --- a/tools/integration-tests.sh +++ b/tools/integration-tests.sh @@ -83,6 +83,9 @@ echo -e "Starting integration tests for VILLASnode:\n" for TEST in ${TESTS}; do TESTNAME=$(basename -s .sh ${TEST}) + # Start time measurement + SECONDS=0 + # Run test if (( ${VERBOSE} == 0 )); then timeout ${TIMEOUT} ${TEST} &> ${LOGDIR}/${TESTNAME}.log @@ -91,6 +94,8 @@ for TEST in ${TESTS}; do timeout ${TIMEOUT} ${TEST} | tee ${LOGDIR}/${TESTNAME}.log RC=${PIPESTATUS[0]} fi + + TOTAL_SECONDS=${SECONDS} # Show full log in case of an error if (( ${VERBOSE} == 0 )); then @@ -101,7 +106,7 @@ for TEST in ${TESTS}; do case $RC in 0) - echo -e "\e[32m[PASS] \e[39m ${TESTNAME}" + echo -e "\e[32m[PASS] \e[39m ${TESTNAME} (ran for ${SECONDS} secs)" PASSED=$((${PASSED} + 1)) ;; 99) @@ -114,7 +119,7 @@ for TEST in ${TESTS}; do FAILED=$((${FAILED} + 1)) ;; *) - echo -e "\e[31m[FAIL] \e[39m ${TESTNAME} with code $RC" + echo -e "\e[31m[FAIL] \e[39m ${TESTNAME} (exited with code $RC, ran for ${SECONDS} secs)" FAILED=$((${FAILED} + 1)) ;; esac