From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30154 invoked by alias); 14 Jan 2003 19:16:16 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 30119 invoked from network); 14 Jan 2003 19:16:14 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (216.138.202.10) by 209.249.29.67 with SMTP; 14 Jan 2003 19:16:14 -0000 Received: from redhat.com (totem.toronto.redhat.com [172.16.14.242]) by touchme.toronto.redhat.com (Postfix) with ESMTP id DAE31800041; Tue, 14 Jan 2003 14:16:01 -0500 (EST) Message-ID: <3E2461F1.7080900@redhat.com> Date: Tue, 14 Jan 2003 19:16:00 -0000 From: Fernando Nasser Organization: Red Hat , Inc. - Toronto User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com, mec@shout.net Subject: Re: [RFA/testsuite] Re: RFC: gdb_test_multiple References: <200301070433.h074XBJ15837@duracef.shout.net> <20030107171034.GA22300@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-01/txt/msg00529.txt.bz2 Hi Daniel, I am _much_ more comfortable with this version. Thanks for spending the time to get it into this format. I believe Michael wanted to give it a spin, but otherwise I think it is ripe to be committed. Thanks to Andrew and Michael for helping with comments. I was away and just came back yesterday. Regards to all, Fernando Daniel Jacobowitz wrote:> On Mon, Jan 06, 2003 at 10:33:11PM -0600, Michael Elizabeth Chastain wrote: > >>>OK. I'll have an even easier version of this done tomorrow; it has one >>>truely gruesome TCL hack in it, but that's it. >> >>I'd like to do another test spin on the new version before you commit >>it if that's all right with you. I can do a cut-down version but I'd >>like to be really sure about sourceware dejagnu because the damn things >>are subtly different, and I normally don't test with it. > > > Here's the version I'd like to include. I definitely need your > reaction to this patch, and Fernando's. I'd like anyone else's, too. > There's one quoting hack in it, but I don't think it's fragile. > > This one is a lot more intuitive. You use it like this: > > gdb_test_multiple $command $message { > -re "\[\r\n\]*($pattern)\[\r\n\]+$gdb_prompt $" { > if ![string match "" $message] then { > pass "$message" > } > } > -re "(${question_string})$" { > send_gdb "$response_string\n"; > exp_continue; > } > } > > There's no magic variable names any more. $pattern and $gdb_prompt in > this example get evaluated in the caller's context; the action blocks > get executed in the caller's context; and in general it behaves just > like expect ought to. > > [That "\[\r\n\]*" is just there because it was previously in gdb_test. > Bonus points to the astute reader who can figure out why it doesn't > need to be there. Presumably the _intent_ was to use "\[\r\n\]+", so > that $pattern needed to match an entire line, but our testsuite doesn't > honor that intent, so this is a question for another day.] > > Fernando, Michael, how does this look? I think it will be useful. > -- Fernando Nasser Red Hat - Toronto E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9