From 52c935b6f53a31185e201524b479e18f3b925981 Mon Sep 17 00:00:00 2001 From: Keith Seitz Date: Tue, 21 May 2013 19:11:50 +0000 Subject: [PATCH] * gdb.base/filesym.exp: Use gdb_test_multiple instead of gdb_expect. Add test to flush the remaining input buffer so that this file passes testsuite/12649. --- gdb/testsuite/ChangeLog | 13 +++++++++++++ gdb/testsuite/gdb.base/filesym.exp | 29 +++++++++++++++-------------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index b93485a2a02..8d77b7df22e 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2013-05-21 Keith Seitz + Pedro Alves + + * gdb.base/filesym.exp: Use gdb_test_multiple instead of + gdb_expect. + Add test to flush the remaining input buffer so that this + file passes testsuite/12649. + 2013-05-21 Philippe Waroquiers * gdb.base/catch-signal-fork.exp: New file. @@ -66,6 +74,11 @@ * gdb.ada/complete.exp: Add test verifying completion using the "tab" key. +2013-05-15 Keith Seitz + + * gdb.base/filesym.exp: New completer test. + * gdb.base/filesym.c: New file. + 2013-05-15 Pedro Alves * gdb.base/fixsection.c: Remove attribution. diff --git a/gdb/testsuite/gdb.base/filesym.exp b/gdb/testsuite/gdb.base/filesym.exp index c9e9c20e1ae..af87d97edb3 100644 --- a/gdb/testsuite/gdb.base/filesym.exp +++ b/gdb/testsuite/gdb.base/filesym.exp @@ -26,25 +26,26 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} { # complete to "filesym"; completing again, we expect the symbol name and the # filename (in that order). +set tst "complete on \"filesy\"" send_gdb "break filesy\t" -gdb_expect { - -re "m\$" { - pass "complete on \"filesy\"" +gdb_test_multiple "" $tst { + -re "break filesy\\\x07m\$" { + pass $tst # Now ask for the completion list + set tst "completion list for \"filesym\"" send_gdb "\t\t" - gdb_expect { - -re ".*filesym\[ \t\]+filesym.c.*$gdb_prompt break filesym\$" { - pass "completion list for \"filesym\"" - } - - default { - fail "completion list for \"filesym\"" + gdb_test_multiple "" $tst { + -re "\\\x07\r\nfilesym\[ \t\]+filesym.c\[ \t\]+\r\n$gdb_prompt " { + pass $tst + + # Flush the rest of the output by creating the breakpoint. + # This ensures this file passes testsuite/12649. + send_gdb "\n" + gdb_test "" "Breakpoint 1.*" "set breakpoint at filesym" } } } - - default { - fail "complete on \"filesy\"" - } } + +unset -nocomplain tst -- 2.30.2