summaryrefslogtreecommitdiff
path: root/testsuite/driver/testlib.py
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/driver/testlib.py')
-rw-r--r--testsuite/driver/testlib.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index 430779bdc0..4e877f51b6 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -1689,6 +1689,11 @@ def normalise_whitespace( str ):
return str
def normalise_errmsg( str ):
+ # remove " error:" and lower-case " Warning:" to make patch for
+ # trac issue #10021 smaller
+ str = modify_lines(str, lambda l: re.sub(' error:', '', l))
+ str = modify_lines(str, lambda l: re.sub(' Warning:', ' warning:', l))
+
# If somefile ends in ".exe" or ".exe:", zap ".exe" (for Windows)
# the colon is there because it appears in error messages; this
# hacky solution is used in place of more sophisticated filename
@@ -1744,6 +1749,10 @@ def normalise_exe_( str ):
return str
def normalise_output( str ):
+ # remove " error:" and lower-case " Warning:" to make patch for
+ # trac issue #10021 smaller
+ str = modify_lines(str, lambda l: re.sub(' error:', '', l))
+ str = modify_lines(str, lambda l: re.sub(' Warning:', ' warning:', l))
# Remove a .exe extension (for Windows)
# This can occur in error messages generated by the program.
str = re.sub('([^\\s])\\.exe', '\\1', str)
@@ -2291,3 +2300,6 @@ def getStdout(cmd_and_args):
return stdout
else:
raise Exception("Need subprocess to get stdout, but don't have it")
+
+def modify_lines(s, f):
+ return '\n'.join([f(l) for l in s.splitlines()])