From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8262 invoked by alias); 4 May 2011 14:21:12 -0000 Received: (qmail 8253 invoked by uid 22791); 4 May 2011 14:21:10 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 May 2011 14:20:49 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p44EKfnf011947 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 4 May 2011 10:20:41 -0400 Received: from host1.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p44EKdx2008285 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 4 May 2011 10:20:41 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p44EKdHE024531; Wed, 4 May 2011 16:20:39 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p44EKcKN024527; Wed, 4 May 2011 16:20:38 +0200 Date: Wed, 04 May 2011 14:21:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: gdb.base/completion.exp - simplify with gdb_test_multiple Message-ID: <20110504142038.GA20147@host1.jankratochvil.net> References: <201105031633.22925.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201105031633.22925.pedro@codesourcery.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 X-SW-Source: 2011-05/txt/msg00090.txt.bz2 On Tue, 03 May 2011 17:33:22 +0200, Pedro Alves wrote: > Anyone feel like taking a look at this? I tested this with and > without Jan's read1 hack from PR testsuite/12649. [...] > --- src.orig/gdb/testsuite/lib/gdb.exp 2011-05-02 16:33:33.709463001 +0100 > +++ src/gdb/testsuite/lib/gdb.exp 2011-05-03 00:20:33.159462999 +0100 > @@ -593,7 +593,7 @@ proc gdb_test_multiple { command message > set message $command > } > > - if [string match "*\[\r\n\]" $command] { > + if { $command != "" && [string match "*\[\r\n\]" $command] } { > error "Invalid trailing newline in \"$message\" test" > } > This part should be dropped as it has no effect and it is not needed. Attached patch either to commit on top of it or integrate it, I do not mind. Thanks, Jan gdb/ 2011-05-04 Jan Kratochvil * gdb.base/completion.exp (complete help info wat): Rename to ... (complete 'help info wat'): ... here. Remove all `-re ".*' and `-re "^.*' redundant regexes. (complete 'p 'arg', complete (2) 'p 'arg'): Remove redundant backslash. --- a/gdb/testsuite/gdb.base/completion.exp +++ b/gdb/testsuite/gdb.base/completion.exp @@ -270,7 +270,7 @@ gdb_test_multiple "" "$test" { } } -set test "complete help info wat" +set test "complete 'help info wat'" send_gdb "help info wat\t" gdb_test_multiple "" "$test" { -re "^help info watchpoints $" { @@ -296,7 +296,7 @@ gdb_test_multiple "" "$test" { -re "^p \"break1\\.c\"$" { send_gdb "\n" gdb_test_multiple "" "$test" { - -re ".*$gdb_prompt $" { + -re "$gdb_prompt $" { pass "$test" } } @@ -314,7 +314,7 @@ gdb_test_multiple "" "$test" { -re "^p \"break1\\.c\"$" { send_gdb "\n" gdb_test_multiple "" "$test" { - -re ".*$gdb_prompt $" { + -re "$gdb_prompt $" { pass "$test" } } @@ -325,7 +325,7 @@ gdb_test_multiple "" "$test" { } } -set test "complete 'p \'arg'" +set test "complete 'p 'arg'" send_gdb "p 'arg\t" gdb_test_multiple "" "$test" { -re "^p 'arg\\\x07$" { @@ -338,13 +338,13 @@ gdb_test_multiple "" "$test" { } } -set test "complete (2) 'p \'arg'" +set test "complete (2) 'p 'arg'" send_gdb "p 'arg\t" gdb_test_multiple "" "$test" { -re "^p 'arg\\\x07$" { send_gdb "\t" gdb_test_multiple "" "$test" { - -re ".*argv.*$gdb_prompt " { + -re "argv.*$gdb_prompt " { send_gdb "\n" gdb_test_multiple "" "$test" { -re "(Invalid character constant\\.|Unmatched single quote\\.).*$gdb_prompt $" { @@ -411,7 +411,7 @@ gdb_test_multiple "" "$test" { -re "^p no_var_named_this-arg\\\x07$" { send_gdb "\t" gdb_test_multiple "" "$test" { - -re ".*argv.*$gdb_prompt " { + -re "argv.*$gdb_prompt " { send_gdb "\n" gdb_test_multiple "" "$test" { -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" { @@ -467,7 +467,7 @@ gdb_test_multiple "" "$test" { } } } - -re ".*argv.*$gdb_prompt $" { + -re "argv.*$gdb_prompt $" { send_gdb "\n" gdb_test_multiple "" "$test" { -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" { @@ -485,7 +485,7 @@ gdb_test_multiple "" "$test" { -re "^p values.0..a_field $" { send_gdb "\n" gdb_test_multiple "" "$test" { - -re "^.* = 0.*$gdb_prompt $" { + -re " = 0.*$gdb_prompt $" { pass "$test" } } @@ -498,7 +498,7 @@ gdb_test_multiple "" "$test" { -re "^p values.0. . a_field $" { send_gdb "\n" gdb_test_multiple "" "$test" { - -re "^.* = 0.*$gdb_prompt $" { + -re " = 0.*$gdb_prompt $" { pass "$test" } } @@ -511,7 +511,7 @@ gdb_test_multiple "" "$test" { -re "^p &values.0. -> a_field $" { send_gdb "\n" gdb_test_multiple "" "$test" { - -re "^.* = .*0x\[0-9a-fA-F\]*.*$gdb_prompt $" { + -re " = .*0x\[0-9a-fA-F\]*.*$gdb_prompt $" { pass "$test" } } @@ -608,7 +608,7 @@ gdb_test_multiple "" "$test" { send_gdb "n\n" exp_continue } - -re ".*$gdb_prompt $" { + -re "$gdb_prompt $" { pass "$test" } }