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.
This commit is contained in:
Tom Tromey
2024-11-20 06:50:17 -07:00
parent 9ba5ef4bf1
commit 523a46ee97

View 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 } }
}