From: Tom Tromey Date: Wed, 20 Nov 2024 13:50:17 +0000 (-0700) Subject: Fix error check in gdb_py_test_silent_cmd X-Git-Tag: gdb-16-branchpoint~147 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=523a46ee9795bbec2d1d5cf7e434adc2a3044f94;p=thirdparty%2Fbinutils-gdb.git Fix error check in gdb_py_test_silent_cmd 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. --- diff --git a/gdb/testsuite/lib/gdb-python.exp b/gdb/testsuite/lib/gdb-python.exp index e27d5c17769..a820c870fd6 100644 --- a/gdb/testsuite/lib/gdb-python.exp +++ b/gdb/testsuite/lib/gdb-python.exp @@ -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 } } }