[Asterisk-code-review] testsuite: Update pretty print to handle the new runtests --... (testsuite[master])
George Joseph
asteriskteam at digium.com
Mon Oct 26 13:08:14 CDT 2015
George Joseph has uploaded a new change for review.
https://gerrit.asterisk.org/1534
Change subject: testsuite: Update pretty_print to handle the new runtests --number option
......................................................................
testsuite: Update pretty_print to handle the new runtests --number option
Change-Id: I437aae3e6e13a6cee1826f3f468257e27edcc0f4
---
M contrib/scripts/pretty_print
1 file changed, 24 insertions(+), 19 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/34/1534/1
diff --git a/contrib/scripts/pretty_print b/contrib/scripts/pretty_print
index 65e0656..7174287 100755
--- a/contrib/scripts/pretty_print
+++ b/contrib/scripts/pretty_print
@@ -13,15 +13,6 @@
exit 1
fi
-declare -ix runnable=0
-declare -ix total=0
-declare -ix passed=0
-declare -ix failed=0
-declare -ix timedout=0
-declare -ix tests=0
-declare -ix maxelapsed=0
-declare -a failures
-declare -a timeouts
declare -ix test_timeout=0
YELLOW='\033[01;33m'
GREEN='\033[01;32m'
@@ -50,6 +41,16 @@
trap 'kill $countpid &>/dev/null' INT ERR
while read line ; do
if [[ $line =~ ^Running.tests.for.(Asterisk.*) ]] ; then
+ declare -ix runnable=0
+ declare -ix total=0
+ declare -ix passed=0
+ declare -ix failed=0
+ declare -ix timedout=0
+ declare -ix tests=0
+ declare -ix maxelapsed=0
+ declare -a failures
+ declare -a timeouts
+
version=${BASH_REMATCH[1]}
starttime=$SECONDS
fi
@@ -57,6 +58,7 @@
if [[ $line =~ ^Tests.to.run:.([0-9]+),[\ ]+Maximum.test.inactivity.time:.([0-9-]+) ]] ; then
runnable=${BASH_REMATCH[1]}
export test_timeout=${BASH_REMATCH[2]}
+ echo =============================================================
echo ${line/-1/unlimited}
printf "[%-*.*s ][%-11s][%s][${GREEN}%4s${NORM}][${RED}%4s${NORM}]\n" $col $col "Test" " Test" "Status" "Pass" "Fail"
fi
@@ -99,22 +101,25 @@
kill $countpid
printf "[${COLOR}%s${NORM}][${GREEN}%4d${NORM}][${RED}%4d${NORM}]\n" $label $passed $failed
fi
+
+ if [[ $line =~ TEST\ RESULTS ]] ; then
+ for fail in "${failures[@]}" ; do
+ echo -e "${RED}$fail${NORM}"
+ done
+ for to in "${timeouts[@]}" ; do
+ echo -e "${YELLOW}$to${NORM}"
+ done
+
+ elapsed=$(( $SECONDS - $starttime ))
+ time="$(( $elapsed / 60 ))m $(( $elapsed % 60 ))s"
+ echo -e "Tests: $runnable ${GREEN}Passed: $passed ${RED}Failed: $failed TimedOut: $timedout${NORM} Time: $time\tLongest test: ${maxelapsed}s"
+ fi
done
trap - INT ERR
kill $countpid &>/dev/null
-for fail in "${failures[@]}" ; do
- echo -e "${RED}$fail${NORM}"
-done
-for to in "${timeouts[@]}" ; do
- echo -e "${YELLOW}$to${NORM}"
-done
-
-elapsed=$(( $SECONDS - $starttime ))
-time="$(( $elapsed / 60 ))m $(( $elapsed % 60 ))s"
-echo -e "Tests: $runnable ${GREEN}Passed: $passed ${RED}Failed: $failed TimedOut: $timedout${NORM} Time: $time\tLongest test: ${maxelapsed}s"
--
To view, visit https://gerrit.asterisk.org/1534
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I437aae3e6e13a6cee1826f3f468257e27edcc0f4
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: George Joseph <george.joseph at fairview5.com>
More information about the asterisk-code-review
mailing list