[Asterisk-code-review] pretty print: Update the result regex (testsuite[14])

George Joseph asteriskteam at digium.com
Fri May 11 09:10:51 CDT 2018


George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/8961 )

Change subject: pretty_print: Update the result regex
......................................................................

pretty_print: Update the result regex

Depending on teh branch of the testsuite being run, the test result
line may or may not have the name of the python module that actually
runs the test...  Example:

Test ['./lib/python/asterisk/test_runner.py', 'tests/abc'] passed
or
Test ['tests/abc'] passed

This patch updates the regex that matches the test result to acount
for both situations.

Change-Id: I2349109d062629b97b2e2a5a40402395d7863448
---
M contrib/scripts/pretty_print
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Jenkins2: Verified
  George Joseph: Looks good to me, approved; Approved for Submit



diff --git a/contrib/scripts/pretty_print b/contrib/scripts/pretty_print
index d7df421..8ee22d8 100755
--- a/contrib/scripts/pretty_print
+++ b/contrib/scripts/pretty_print
@@ -145,10 +145,10 @@
 		fi
 	fi
 
-	if [[ $line =~ ^Test\ *\[\'[^\']+\',\ *\'tests/([^\']+)\'(, \'[^\']+\')?\]\ *(passed|failed|timed\ out)$ ]] ; then
-		test=${BASH_REMATCH[1]}
-		_unused_arg=${BASH_REMATCH[2]}
-		status=${BASH_REMATCH[3]}
+	if [[ $line =~ ^Test\ *\[(\'[^\']+\',)?\ *\'tests/([^\']+)\'(, \'[^\']+\')?\]\ *(passed|failed|timed\ out)$ ]] ; then
+		test=${BASH_REMATCH[2]}
+		_unused_arg=${BASH_REMATCH[3]}
+		status=${BASH_REMATCH[4]}
 		col=$(( ${TERM_WIDTH:-$(tput cols)} - ${#status_string} ))
 		et=$(( $SECONDS - $st ))
 		[ $countpid -gt 0 ] && kill $countpid

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

Gerrit-Project: testsuite
Gerrit-Branch: 14
Gerrit-MessageType: merged
Gerrit-Change-Id: I2349109d062629b97b2e2a5a40402395d7863448
Gerrit-Change-Number: 8961
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180511/51cc5cfa/attachment-0001.html>


More information about the asterisk-code-review mailing list