From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27523 invoked by alias); 2 Jun 2010 22:31:59 -0000 Received: (qmail 27510 invoked by uid 22791); 2 Jun 2010 22:31:58 -0000 X-SWARE-Spam-Status: No, hits=-5.8 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, 02 Jun 2010 22:31:53 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o52MVSpJ006264 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 2 Jun 2010 18:31:29 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o52MVPhX021476 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 2 Jun 2010 18:31:27 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o52MVPZL002433; Thu, 3 Jun 2010 00:31:25 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o52MVOsA002432; Thu, 3 Jun 2010 00:31:24 +0200 Date: Wed, 02 Jun 2010 22:31:00 -0000 From: Jan Kratochvil To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: [patch] testsuite: Error on trailing newlines [Re: [obv] testsuite: gdb.cp/ref-types.exp: Excessive newline] Message-ID: <20100602223124.GA2335@host0.dyn.jankratochvil.net> References: <20100602214003.GA31569@host0.dyn.jankratochvil.net> <20100602214350.GC3019@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100602214350.GC3019@adacore.com> User-Agent: Mutt/1.5.20 (2009-12-10) 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: 2010-06/txt/msg00082.txt.bz2 On Wed, 02 Jun 2010 23:43:50 +0200, Joel Brobecker wrote: > How about automatically catching those? I wonder what would happen if > we raised an exception if the command sent by gdb_test ended in a > newline? Same question about gdb_test_multiple... It now generates some: Running ./gdb.cp/ref-types.exp ... ERROR: tcl error sourcing ./gdb.cp/ref-types.exp. ERROR: gdb_test_multiple: "print value of UI" used trailing newline while executing "error "gdb_test_multiple: \"$message\" used trailing newline"" invoked from within "if [string match "*\[\r\n\]" $command] { No regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu. (But in fact the fixed testcases were tested only on x86_64-fedora13-linux-gnu. OK to check-in? There may be regressions for testcases not tested on this platform. Thanks, Jan gdb/testsuite/ 2010-06-03 Jan Kratochvil * lib/gdb.exp (gdb_test_multiple): Error on trailing newlines. * gdb.base/commands.exp (add printf tbreak command): Remove trailing newline. * gdb.gdb/complaints.exp (empty non-verbose non-noisy clear) (empty verbose non-noisy clear, empty verbose noisy clear) (empty non-verbose noisy clear): Likewise. --- a/gdb/testsuite/gdb.base/commands.exp +++ b/gdb/testsuite/gdb.base/commands.exp @@ -503,7 +503,7 @@ proc temporary_breakpoint_commands {} { pass "add silent tbreak command" } } - gdb_test_multiple "printf \"factorial tbreak commands executed\\n\"\n" \ + gdb_test_multiple "printf \"factorial tbreak commands executed\\n\"" \ "add printf tbreak command" { -re ">$" { pass "add printf tbreak command" --- a/gdb/testsuite/gdb.gdb/complaints.exp +++ b/gdb/testsuite/gdb.gdb/complaints.exp @@ -207,13 +207,13 @@ proc test_empty_complaint { cmd msg } { proc test_empty_complaints { } { - test_empty_complaint "call clear_complaints(&symfile_complaints,0,0)\n" \ + test_empty_complaint "call clear_complaints(&symfile_complaints,0,0)" \ "empty non-verbose non-noisy clear" - test_empty_complaint "call clear_complaints(&symfile_complaints,1,0)\n" \ + test_empty_complaint "call clear_complaints(&symfile_complaints,1,0)" \ "empty verbose non-noisy clear" - test_empty_complaint "call clear_complaints(&symfile_complaints,1,1)\n" \ + test_empty_complaint "call clear_complaints(&symfile_complaints,1,1)" \ "empty verbose noisy clear" - test_empty_complaint "call clear_complaints(&symfile_complaints,0,1)\n" \ + test_empty_complaint "call clear_complaints(&symfile_complaints,0,1)" \ "empty non-verbose noisy clear" return 0 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -573,6 +573,10 @@ proc gdb_test_multiple { command message user_code } { set message $command } + if [string match "*\[\r\n\]" $command] { + error "gdb_test_multiple: \"$message\" used trailing newline" + } + # TCL/EXPECT WART ALERT # Expect does something very strange when it receives a single braced # argument. It splits it along word separators and performs substitutions.