1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

tests: show elapsed time per test case

This commit is contained in:
Steffen Vogel 2019-06-26 20:37:47 +02:00
parent f71643813f
commit 61eb669f0c

View file

@ -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