Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(330)

Issue 5728047: [contrib] Fix match pattern for summary lines in validate_failures.py (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 1 month ago by Diego Novillo
Modified:
12 years, 1 month ago
Reviewers:
CC:
davidxl, gcc-patches_gcc.gnu.org
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -4 lines) Patch
M contrib/testsuite-management/validate_failures.py View 1 chunk +8 lines, -4 lines 0 comments Download

Messages

Total messages: 1
Diego Novillo
12 years, 1 month ago (2012-03-02 20:41:44 UTC) #1
This fixes an edge case in parsing summary lines.  Some times, the
description field is missing (e.g., 'FAIL: libstdc++/abi_check'), so
the space that the pattern was looking for does not exist.

I've changed it to match any whitespace, which includes '\n'.  I also
made it print the line that it fails to parse, in case there are other
problems like this in the future.

David, this should fix the failure you were getting in your merge.
Let me know if it doesn't.


2012-03-02   Diego Novillo  <dnovillo@google.com>

	* testsuite-management/validate_failures.py (class TestResult): Fix
	match pattern for the summary line.  If there is a parsing failure,
	show the line we failed to parse.

diff --git a/contrib/testsuite-management/validate_failures.py
b/contrib/testsuite-management/validate_failures.py
index 072de79..7bc5089 100755
--- a/contrib/testsuite-management/validate_failures.py
+++ b/contrib/testsuite-management/validate_failures.py
@@ -97,10 +97,14 @@ class TestResult(object):
       self.attrs = ''
       if '|' in summary_line:
         (self.attrs, summary_line) = summary_line.split('|', 1)
-      (self.state,
-       self.name,
-       self.description) = re.match(r' *([A-Z]+): ([^ ]+) (.*)',
-                                    summary_line).groups()
+      try:
+        (self.state,
+         self.name,
+         self.description) = re.match(r' *([A-Z]+): (\S+)\s(.*)',
+                                      summary_line).groups()
+      except:
+        print 'Failed to parse summary line: "%s"' % summary_line
+        raise
       self.attrs = self.attrs.strip()
       self.state = self.state.strip()
       self.description = self.description.strip()

--
This patch is available for review at http://codereview.appspot.com/5728047
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b