From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17187 invoked by alias); 17 May 2013 10:52:01 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 17178 invoked by uid 89); 17 May 2013 10:52:01 -0000 X-Spam-SWARE-Status: No, score=-8.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 17 May 2013 10:52:00 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4HApxiO004893 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 17 May 2013 06:51:59 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r4HApvvp030961; Fri, 17 May 2013 06:51:58 -0400 Message-ID: <51960BCD.7070404@redhat.com> Date: Fri, 17 May 2013 10:52:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 MIME-Version: 1.0 To: Keith Seitz CC: "gdb-patches@sourceware.org ml" Subject: Re: [RFA] gdb_expect -> gdb_test_multiple for filesym.exp References: <51951EAC.9090607@redhat.com> <51952C91.5040605@redhat.com> <51952E71.90601@redhat.com> <51953173.70002@redhat.com> <5195440D.6070601@redhat.com> In-Reply-To: <5195440D.6070601@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-05/txt/msg00677.txt.bz2 On 05/16/2013 09:39 PM, Keith Seitz wrote: > On 05/16/2013 12:20 PM, Pedro Alves wrote: >> On 05/16/2013 08:07 PM, Keith Seitz wrote: >> >>> It can be easily removed, if you wished. Just let me know. >> >> It's fine with me as is. > > Actually, I'm revising this test a tiny bit. Jan mentioned privately that this test was failing the read1 test scenario (see testsuite/12649). With this update, the patch now passes that, too. Ah, missed that indeed. As long as we're revising... :-) > +set tst "complete on \"filesy\"" > send_gdb "break filesy\t" > -gdb_expect { > - -re "m\$" { > - pass "complete on \"filesy\"" > +gdb_test_multiple "" $tst { > + -re "m\$" { > + pass $tst IMO, \t completion tests should check the whole expected line. That's because '-re "m' matches anything before that "m". So, say, this plausible bug where we'd complete the whole word instead of just the missing letter "break filesy\t" -> "break filesyfilesym" would go unnoticed. That's how the tests in completion.exp work too. > > # 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\"" > - } > + gdb_test_multiple "" $tst { > + -re ".*filesym\[ \t\]+filesym.c.*$gdb_prompt " { > + pass $tst Likewise, this would accept 3 or more entries, as long as the expect 2 are there. IOW, here's what IMO the test should end up like. set tst "complete on \"filesy\"" send_gdb "break filesy\t" 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_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" } } } } -- Pedro Alves