mirror of git://gcc.gnu.org/git/gcc.git
validate_failures.py: Fix handling of summary lines with "|" characters or empty description fields.
* testsuite-management/validate_failures.py: Fix handling of summary lines with "|" characters or empty description fields. From-SVN: r199765
This commit is contained in:
parent
37684c4633
commit
76ba1222c5
|
|
@ -1,3 +1,8 @@
|
||||||
|
2013-06-06 Brooks Moses <bmoses@google.com>
|
||||||
|
|
||||||
|
* testsuite-management/validate_failures.py: Fix handling of
|
||||||
|
summary lines with "|" characters or empty description fields.
|
||||||
|
|
||||||
2013-05-24 Chung-Ju Wu <jasonwucj@gmail.com>
|
2013-05-24 Chung-Ju Wu <jasonwucj@gmail.com>
|
||||||
|
|
||||||
* download_prerequisites: Download isl and cloog conditionally.
|
* download_prerequisites: Download isl and cloog conditionally.
|
||||||
|
|
|
||||||
|
|
@ -119,20 +119,15 @@ class TestResult(object):
|
||||||
|
|
||||||
def __init__(self, summary_line, ordinal=-1):
|
def __init__(self, summary_line, ordinal=-1):
|
||||||
try:
|
try:
|
||||||
self.attrs = ''
|
(self.attrs, summary_line) = SplitAttributesFromSummaryLine(summary_line)
|
||||||
if '|' in summary_line:
|
|
||||||
(self.attrs, summary_line) = summary_line.split('|', 1)
|
|
||||||
try:
|
try:
|
||||||
(self.state,
|
(self.state,
|
||||||
self.name,
|
self.name,
|
||||||
self.description) = re.match(r' *([A-Z]+):\s*(\S+)\s+(.*)',
|
self.description) = re.match(r'([A-Z]+):\s*(\S+)\s*(.*)',
|
||||||
summary_line).groups()
|
summary_line).groups()
|
||||||
except:
|
except:
|
||||||
print 'Failed to parse summary line: "%s"' % summary_line
|
print 'Failed to parse summary line: "%s"' % summary_line
|
||||||
raise
|
raise
|
||||||
self.attrs = self.attrs.strip()
|
|
||||||
self.state = self.state.strip()
|
|
||||||
self.description = self.description.strip()
|
|
||||||
self.ordinal = ordinal
|
self.ordinal = ordinal
|
||||||
except ValueError:
|
except ValueError:
|
||||||
Error('Cannot parse summary line "%s"' % summary_line)
|
Error('Cannot parse summary line "%s"' % summary_line)
|
||||||
|
|
@ -208,11 +203,20 @@ def IsComment(line):
|
||||||
return line.startswith('#')
|
return line.startswith('#')
|
||||||
|
|
||||||
|
|
||||||
|
def SplitAttributesFromSummaryLine(line):
|
||||||
|
"""Splits off attributes from a summary line, if present."""
|
||||||
|
if '|' in line and not _VALID_TEST_RESULTS_REX.match(line):
|
||||||
|
(attrs, line) = line.split('|', 1)
|
||||||
|
attrs = attrs.strip()
|
||||||
|
else:
|
||||||
|
attrs = ''
|
||||||
|
line = line.strip()
|
||||||
|
return (attrs, line)
|
||||||
|
|
||||||
|
|
||||||
def IsInterestingResult(line):
|
def IsInterestingResult(line):
|
||||||
"""Return True if line is one of the summary lines we care about."""
|
"""Return True if line is one of the summary lines we care about."""
|
||||||
if '|' in line:
|
(_, line) = SplitAttributesFromSummaryLine(line)
|
||||||
(_, line) = line.split('|', 1)
|
|
||||||
line = line.strip()
|
|
||||||
return bool(_VALID_TEST_RESULTS_REX.match(line))
|
return bool(_VALID_TEST_RESULTS_REX.match(line))
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -416,8 +420,9 @@ def PerformComparison(expected, actual, ignore_missing_failures):
|
||||||
if not ignore_missing_failures and len(expected_vs_actual) > 0:
|
if not ignore_missing_failures and len(expected_vs_actual) > 0:
|
||||||
PrintSummary('Expected results not present in this build (fixed tests)'
|
PrintSummary('Expected results not present in this build (fixed tests)'
|
||||||
'\n\nNOTE: This is not a failure. It just means that these '
|
'\n\nNOTE: This is not a failure. It just means that these '
|
||||||
'tests were expected\nto fail, but they worked in this '
|
'tests were expected\nto fail, but either they worked in '
|
||||||
'configuration.\n', expected_vs_actual)
|
'this configuration or they were not\npresent at all.\n',
|
||||||
|
expected_vs_actual)
|
||||||
|
|
||||||
if tests_ok:
|
if tests_ok:
|
||||||
print '\nSUCCESS: No unexpected failures.'
|
print '\nSUCCESS: No unexpected failures.'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue