[Asterisk-code-review] Update pretty print to not look for asterisk version in output (testsuite[master])

George Joseph asteriskteam at digium.com
Tue Apr 3 08:40:58 CDT 2018


George Joseph has uploaded this change for review. ( https://gerrit.asterisk.org/8709


Change subject: Update pretty_print to not look for asterisk version in output
......................................................................

Update pretty_print to not look for asterisk version in output

This change is backwards compatible with all testsuite versions/branches.

Change-Id: Ibed22c46fc3b7bd71dffde93b900c6ed861eba8a
---
M contrib/scripts/pretty_print
1 file changed, 7 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/09/8709/1

diff --git a/contrib/scripts/pretty_print b/contrib/scripts/pretty_print
index 200b0b3..d7df421 100755
--- a/contrib/scripts/pretty_print
+++ b/contrib/scripts/pretty_print
@@ -111,10 +111,10 @@
 	buffer+=("$line")
 
 	### Running tests for Asterisk GIT-master-99dea9b (run 1 of 1)...
-	if [[ $line =~ ^Running\ tests\ for\ (Asterisk\ +[^\ ]+)\ +\(run\ +([0-9]+)\ +of\ +([0-9]+)\)\.\.\. ]] ; then
-		run=${BASH_REMATCH[2]}
-		runs=${BASH_REMATCH[3]}
-		version=${BASH_REMATCH[1]}
+	### The version may or may not not be present.
+	if [[ $line =~ ^Running\ tests\ for\ Asterisk[^\(]*\(run\ +([0-9]+)\ +of\ +([0-9]+)\)\.\.\. ]] ; then
+		run=${BASH_REMATCH[1]}
+		runs=${BASH_REMATCH[2]}
 	fi
 	### Tests to run: 11 * 1 time(s) = 11  Maximum test inactivity time: 120 sec.
 	if [[ $run -eq 1 && $line =~ ^Tests\ to\ run:\ +([0-9]+)\ +\*\ +([0-9]+)\ +time\(s\)\ +=\ +([0-9]+)\ +Maximum.test.inactivity.time:.([-0-9-]+) ]] ; then
@@ -145,9 +145,10 @@
 		fi
 	fi
 
-	if [[ $line =~ ^Test.*tests/([^\']+)\',.*(passed|failed|timed\ out)$ ]] ; then
+	if [[ $line =~ ^Test\ *\[\'[^\']+\',\ *\'tests/([^\']+)\'(, \'[^\']+\')?\]\ *(passed|failed|timed\ out)$ ]] ; then
 		test=${BASH_REMATCH[1]}
-		status=${BASH_REMATCH[2]}
+		_unused_arg=${BASH_REMATCH[2]}
+		status=${BASH_REMATCH[3]}
 		col=$(( ${TERM_WIDTH:-$(tput cols)} - ${#status_string} ))
 		et=$(( $SECONDS - $st ))
 		[ $countpid -gt 0 ] && kill $countpid

-- 
To view, visit https://gerrit.asterisk.org/8709
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibed22c46fc3b7bd71dffde93b900c6ed861eba8a
Gerrit-Change-Number: 8709
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180403/9cb83d7b/attachment.html>


More information about the asterisk-code-review mailing list