diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 42aae6b30a6..ba3eb59f773 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2021-09-03 Tom de Vries + + * gdb.gdb/complaints.exp: Use untested if clear_complaints cannot + be found. + 2021-09-03 Tom de Vries * lib/selftest-support.exp: Emit untested when not being able to set diff --git a/gdb/testsuite/gdb.gdb/complaints.exp b/gdb/testsuite/gdb.gdb/complaints.exp index c70825b6623..2391d661250 100644 --- a/gdb/testsuite/gdb.gdb/complaints.exp +++ b/gdb/testsuite/gdb.gdb/complaints.exp @@ -104,6 +104,26 @@ proc test_empty_complaint { cmd msg } { } proc test_empty_complaints { } { + global decimal + + set re [multi_line \ + "All functions matching regular expression \[^:\]*:" \ + "" \ + "File \[^\r\n\]*/complaints\\.c:" \ + "$decimal:\tvoid clear_complaints\\(\\);"] + + set found 0 + gdb_test_multiple "info function ^clear_complaints()$" "" { + -re -wrap $re { + set found 1 + } + -re -wrap "" { + } + } + if { ! $found } { + untested "Cannot find clear_complaints, skipping test" + return 0 + } test_empty_complaint "call clear_complaints()" \ "clear complaints"