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

George Joseph asteriskteam at digium.com
Thu May 10 10:49:26 CDT 2018


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


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(-)



  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/59/8959/1

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/8959
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: 15
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2349109d062629b97b2e2a5a40402395d7863448
Gerrit-Change-Number: 8959
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/20180510/b3308076/attachment-0001.html>


More information about the asterisk-code-review mailing list