]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix error check in gdb_py_test_silent_cmd
authorTom Tromey <tromey@adacore.com>
Wed, 20 Nov 2024 13:50:17 +0000 (06:50 -0700)
committerTom Tromey <tromey@adacore.com>
Mon, 9 Dec 2024 21:16:46 +0000 (14:16 -0700)
I added a new test using gdb_py_test_silent_cmd, and then was
surprised to find out that the new test passed -- it caused a Python
exception and I had expected it to fail.  This patch fixes this proc
to detect this situation and fail.

gdb/testsuite/lib/gdb-python.exp

index e27d5c1776931990d29bf1660f214f0c60be510d..a820c870fd6028c0e73d11770d95f09045aa8582 100644 (file)
@@ -22,6 +22,7 @@ proc gdb_py_test_silent_cmd { cmd name report_pass } {
     global gdb_prompt
 
     gdb_test_multiple $cmd $name {
+       -re "Error occurred in Python:.*$gdb_prompt $" { fail $name }
        -re "Traceback.*$gdb_prompt $" { fail $name }
        -re "$gdb_prompt $"            { if $report_pass { pass $name } }
     }