From 4d4bb30b41aaf902e4ad21e4b314950c705447bc Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Wed, 25 Jun 2025 12:37:35 +0200 Subject: [gdb/testsuite] Fix gdb.python/py-warning.exp with python 3.6 On openSUSE Tumbleweed (with python 3.13), I get: ... (gdb) PASS: gdb.python/py-warning.exp: python gdb.warning("") python gdb.warning()^M Python Exception : \ function missing required argument 'text' (pos 1)^M Error occurred in Python: function missing required argument 'text' (pos 1)^M (gdb) PASS: gdb.python/py-warning.exp: python gdb.warning() ... But on openSUSE Leap 15.6 (with python 3.6), I get instead: ... (gdb) PASS: gdb.python/py-warning.exp: python gdb.warning("") python gdb.warning()^M Python Exception : \ Required argument 'text' (pos 1) not found^M Error occurred in Python: Required argument 'text' (pos 1) not found^M (gdb) FAIL: gdb.python/py-warning.exp: python gdb.warning() ... Fix this by updating the regexp. Tested on x86_64-linux. PR testsuite/33104 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33104 --- gdb/testsuite/gdb.python/py-warning.exp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'gdb') diff --git a/gdb/testsuite/gdb.python/py-warning.exp b/gdb/testsuite/gdb.python/py-warning.exp index b0256fa..6b26a4e 100644 --- a/gdb/testsuite/gdb.python/py-warning.exp +++ b/gdb/testsuite/gdb.python/py-warning.exp @@ -40,7 +40,24 @@ gdb_test "python gdb.warning(\"\")" \ "Error occurred in Python: Empty text string passed to gdb\\.warning"] # Missing argument gives an error. -gdb_test "python gdb.warning()" \ +set re1 \ [multi_line \ - "Python Exception : function missing required argument 'text' \\(pos 1\\)" \ - "Error occurred in Python: function missing required argument 'text' \\(pos 1\\)"] + [string_to_regexp \ + [concat \ + "Python Exception :" \ + "function missing required argument 'text' (pos 1)"]] \ + [string_to_regexp \ + [concat \ + "Error occurred in Python:" \ + "function missing required argument 'text' (pos 1)"]]] +set re2 \ + [multi_line \ + [string_to_regexp \ + [concat \ + "Python Exception :" \ + "Required argument 'text' (pos 1) not found"]] \ + [string_to_regexp \ + [concat \ + "Error occurred in Python:" \ + "Required argument 'text' (pos 1) not found"]]] +gdb_test "python gdb.warning()" $re1|$re2 -- cgit v1.1