]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #17712: Fix test_gdb failures on Ubuntu 13.04.
authorAntoine Pitrou <solipsis@pitrou.net>
Tue, 30 Apr 2013 22:15:44 +0000 (00:15 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Tue, 30 Apr 2013 22:15:44 +0000 (00:15 +0200)
Lib/test/test_gdb.py
Misc/NEWS

index 9d8ff8ed8a1a7e6d12b5f7562938e80d0a5451bb..5302b5adb428635c81a792bd1e643a87e0197771 100644 (file)
@@ -142,30 +142,32 @@ class DebuggerTests(unittest.TestCase):
         # Use "args" to invoke gdb, capturing stdout, stderr:
         out, err = run_gdb(*args, PYTHONHASHSEED='0')
 
-        # Ignore some noise on stderr due to the pending breakpoint:
-        err = err.replace('Function "%s" not defined.\n' % breakpoint, '')
-        # Ignore some other noise on stderr (http://bugs.python.org/issue8600)
-        err = err.replace("warning: Unable to find libthread_db matching"
-                          " inferior's thread library, thread debugging will"
-                          " not be available.\n",
-                          '')
-        err = err.replace("warning: Cannot initialize thread debugging"
-                          " library: Debugger service failed\n",
-                          '')
-        err = err.replace('warning: Could not load shared library symbols for '
-                          'linux-vdso.so.1.\n'
-                          'Do you need "set solib-search-path" or '
-                          '"set sysroot"?\n',
-                          '')
-        err = err.replace('warning: Could not load shared library symbols for '
-                          'linux-gate.so.1.\n'
-                          'Do you need "set solib-search-path" or '
-                          '"set sysroot"?\n',
-                          '')
+        errlines = err.splitlines()
+        unexpected_errlines = []
+
+        # Ignore some benign messages on stderr.
+        ignore_patterns = (
+            'Function "%s" not defined.' % breakpoint,
+            "warning: no loadable sections found in added symbol-file"
+            " system-supplied DSO",
+            "warning: Unable to find libthread_db matching"
+            " inferior's thread library, thread debugging will"
+            " not be available.",
+            "warning: Cannot initialize thread debugging"
+            " library: Debugger service failed",
+            'warning: Could not load shared library symbols for '
+            'linux-vdso.so',
+            'warning: Could not load shared library symbols for '
+            'linux-gate.so',
+            'Do you need "set solib-search-path" or '
+            '"set sysroot"?',
+            )
+        for line in errlines:
+            if not line.startswith(ignore_patterns):
+                unexpected_errlines.append(line)
 
         # Ensure no unexpected error messages:
-        self.assertEqual(err, '')
-
+        self.assertEqual(unexpected_errlines, [])
         return out
 
     def get_gdb_repr(self, source,
index 4b7b3a263a44f3ac71e89ccbc52d07ec57f46f5d..b61bf230d18e5dc21f9212ee0b7226521f6b51d6 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -76,6 +76,8 @@ Library
 Tests
 -----
 
+- Issue #17712: Fix test_gdb failures on Ubuntu 13.04.
+
 - Issue #17065: Use process-unique key for winreg tests to avoid failures if
   test is run multiple times in parallel (eg: on a buildbot host).