The validate_failures.py script in contrib/testsuite-management expects the first "|" character in a test summary line to be a delineator allowing the line to be prefixed by attributes such as "flaky". This causes problems when a test line itself contains "|" in the message.

We can get around this in the xfail file by prefixing the line with "|" to indicate an empty attribute set. However, validate_failures.py uses the same line-parser for files in the DejaGnu output, and we obviously can't adjust those -- with the result that the relevant summary line in the DejaGnu output is ignored.

This patch fixes the problem: If an entire line is a valid summary line, we don't try to split it.

Ok to commit?

- Brooks


----
2013-05-31  Brooks Moses  <bmo...@google.com>

        * validate_failures.py: Don't split already-valid summary lines.
The validate_failures.py script in contrib/testsuite-management expects the
first "|" character in a test summary line to be a delineator allowing the
line to be prefixed by attributes such as "flaky".  This causes problems when
a test line itself contains "|" in the message.

We can get around this in the xfail file by prefixing the line with "|" to
indicate an empty attribute set.  However, validate_failures.py uses the same
line-parser for files in the DejaGnu output, and we obviously can't adjust
those -- with the result that the relevant summary line in the DejaGnu output
is ignored.

This patch fixes the problem: If an entire line is a valid summary line, we don't
try to split it.

Index: contrib/testsuite-management/validate_failures.py
===================================================================
--- contrib/testsuite-management/validate_failures.py	(revision 199390)
+++ contrib/testsuite-management/validate_failures.py	(working copy)
@@ -120,7 +120,7 @@
   def __init__(self, summary_line, ordinal=-1):
     try:
       self.attrs = ''
-      if '|' in summary_line:
+      if '|' in summary_line and not _VALID_TEST_RESULTS_REX.match(summary_line):
         (self.attrs, summary_line) = summary_line.split('|', 1)
       try:
         (self.state,
@@ -210,7 +210,7 @@
 
 def IsInterestingResult(line):
   """Return True if line is one of the summary lines we care about."""
-  if '|' in line:
+  if '|' in line and not _VALID_TEST_RESULTS_REX.match(line):
     (_, line) = line.split('|', 1)
     line = line.strip()
   return bool(_VALID_TEST_RESULTS_REX.match(line))

Reply via email to