diff --git a/mk/run_test.sh b/mk/run_test.sh index 3783d3bf7..9353db91e 100755 --- a/mk/run_test.sh +++ b/mk/run_test.sh @@ -15,14 +15,18 @@ if [ -t 1 ]; then normal="" fi (cd tests && env ${TESTS_ENVIRONMENT} init.sh 2>/dev/null > /dev/null) + +start_time=$(date -u +%s) log="$(cd $(dirname $1) && env ${TESTS_ENVIRONMENT} $(basename $1) 2>&1)" -status=$? +stop_time=$(date -u +%s) +elapsed_time=$(($stop_time-$start_time)) + if [ $status -eq 0 ]; then - echo "$post_run_msg [${green}PASS$normal]" + echo "$post_run_msg [${green}PASS$normal] in ${elapsed_time}s" elif [ $status -eq 99 ]; then - echo "$post_run_msg [${yellow}SKIP$normal]" + echo "$post_run_msg [${yellow}SKIP$normal] after ${elapsed_time}s" else - echo "$post_run_msg [${red}FAIL$normal]" + echo "$post_run_msg [${red}FAIL$normal] in ${elapsed_time}s" echo "$log" | sed 's/^/ /' exit "$status" fi