From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25825 invoked by alias); 24 Jun 2002 20:20:35 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 25798 invoked from network); 24 Jun 2002 20:20:32 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 24 Jun 2002 20:20:32 -0000 Received: from localhost.redhat.com (remus.sfbay.redhat.com [172.16.27.252]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id NAA01680; Mon, 24 Jun 2002 13:20:22 -0700 (PDT) Received: by localhost.redhat.com (Postfix, from userid 469) id 31E20107D4; Mon, 24 Jun 2002 16:19:37 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15639.32472.649318.105460@localhost.redhat.com> Date: Mon, 24 Jun 2002 13:20:00 -0000 To: Keith Seitz Cc: Subject: Re: [MI/testsuite] mi_gdb_test: expected result priority? In-Reply-To: References: X-SW-Source: 2002-06/txt/msg00223.txt.bz2 Keith Seitz writes: > Hi, > > I've been writing some MI tests for all the stuff that I've been adding, > and I ran across an anomaly... > > When mi_gdb_test actually calls expect, it does: > > gdb_expect $tmt { > -re "\\*\\*\\* DOSEXIT code.*" { > if { $message != "" } { > fail "$message"; > } > gdb_suppress_entire_file "GDB died"; > return -1; > } > -re "Ending remote debugging.*$mi_gdb_prompt\[ \]*$" { > if ![isnative] then { > warning "Can`t communicate to remote target." > } > gdb_exit > gdb_start > set result -1 > } > -re "(${question_string})$" { > send_gdb "$response_string\n"; > exp_continue; > } > -re "Undefined.* command:.*$mi_gdb_prompt\[ \]*$" { > perror "Undefined command \"$command\"." > fail "$message" > set result 1 > } > -re "Ambiguous command.*$mi_gdb_prompt\[ \]*$" { > perror "\"$command\" is not a unique command name." > fail "$message" > set result 1 > } > -re "\[\r\n\]*($pattern)\[\r\n\]+$mi_gdb_prompt\[ \]*$" { > if ![string match "" $message] then { > pass "$message" > } > set result 0 > } > > > The astute reader will notice that the _real_ expected pattern by the > caller is pre-empted by several other patterns. Therefore if one wanted to > write a test to check for the string "Ambiguous command", well, you'd > automatically get a fail. Likewise, if you wanted to write a test that > checked for the string "Undefined command: \"bogus\". Try \"help\"." > (which I am trying to do), one is screwed. > > Is there any particular reason to not move the real expected result > pattern higher in the list (like to/near the top or something)?? > > Keith Hmm, nothing has changed in that procedure since day one. It is kind of a copy of the gdb_test one in gdb.exp. Maybe you can rearrange the patterns to be like gdb_test? The 'pass' occurs earlier in there. Elena