From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 938 invoked by alias); 2 Jun 2010 23:02:51 -0000 Received: (qmail 32541 invoked by uid 22791); 2 Jun 2010 23:02:47 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 02 Jun 2010 23:02:42 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id B840D2BAC88; Wed, 2 Jun 2010 19:02:40 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id hruB3r0GzYBY; Wed, 2 Jun 2010 19:02:40 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 81E122BAC86; Wed, 2 Jun 2010 19:02:40 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id DF705F58FA; Wed, 2 Jun 2010 16:02:35 -0700 (PDT) Date: Wed, 02 Jun 2010 23:02:00 -0000 From: Joel Brobecker To: Jan Kratochvil Cc: gdb-patches@sourceware.org Subject: Re: [patch] testsuite: Error on trailing newlines [Re: [obv] testsuite: gdb.cp/ref-types.exp: Excessive newline] Message-ID: <20100602230235.GH3019@adacore.com> References: <20100602214003.GA31569@host0.dyn.jankratochvil.net> <20100602214350.GC3019@adacore.com> <20100602223124.GA2335@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100602223124.GA2335@host0.dyn.jankratochvil.net> User-Agent: Mutt/1.5.20 (2009-06-14) 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/msg00089.txt.bz2 > 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] { Thanks for doing that. I think it's a step in the right direction. I did double-check the implementation of gdb_test_multiple and it showed that the \n is added there (so should never be added by the caller), and that a trailing \n would cause the function to send an empty command. The problem is that we are probably removing the ability of using that function to test repeat/non-repeat commands. But I think that this is the exception rather than the norm, and I suggest we use... send_gdb "\n" gdb_test/gdb_test_multiple "" [...] ... when we want to send empty commands. > OK to check-in? There may be regressions for testcases not tested on this > platform. I think that's fine, it's easy to fix. > * 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. This part is definitely OK (you've treated them as obvious so far). So let's commit them now. > * lib/gdb.exp (gdb_test_multiple): Error on trailing newlines. This part is OK as far as I am concerned, but let's hold off on it for a couple of days, to see if others have any comment about it. I'd like to take this opportunity to adjust the error message a bit to make it clearer that it's the command that has a trailing new-line, not the message. Something like this, maybe? Invalid trailing newline in \"$message\" test ? I don't mind the gdb_test_multiple in the error message if you think it makes a difference, but I can see how it can confuse people who are not familiar with the testsuite infrastructure if the test was written using gdb_test... -- Joel