From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27135 invoked by alias); 9 Nov 2016 01:56:53 -0000 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 Received: (qmail 27018 invoked by uid 89); 9 Nov 2016 01:56:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy= X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 Nov 2016 01:56:40 +0000 Received: by simark.ca (Postfix, from userid 33) id 452741E75C; Tue, 8 Nov 2016 20:56:39 -0500 (EST) To: Pedro Alves Subject: Re: [PATCH v2 1/5] gdb/testsuite: Introduce "proc_with_prefix" X-PHP-Originating-Script: 33:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 09 Nov 2016 01:56:00 -0000 From: Simon Marchi Cc: gdb-patches@sourceware.org In-Reply-To: <1478650771-24430-2-git-send-email-palves@redhat.com> References: <1478650771-24430-1-git-send-email-palves@redhat.com> <1478650771-24430-2-git-send-email-palves@redhat.com> Message-ID: <79350921c479daa902253c180b12842a@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.2 X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg00202.txt.bz2 On 2016-11-08 19:19, Pedro Alves wrote: > While adding new tests to gdb.base/commands.exp, I noticed that the > file includes a bunch of individual testcases split into their own > procedures, and that none have ever been adjusted to use > with_test_prefix. Instead, each gdb_test/gdb_test_multiple/etc > invocation takes care of including the procedure name in the test > message, in order to make sure test messages are unique. > > Simon convinced me that using the procedure name as prefix is not that > bad of an idea: > https://sourceware.org/ml/gdb-patches/2016-10/msg00020.html > > This commit adds an IMO simpler alternative to > with_test_prefix_procname added by that patch -- a new > "proc_with_prefix" convenience proc that is meant to be used in place > of "proc", and then uses it in commands.exp. Procedures defined with > this automatically run their bodies under with_test_prefix $proc_name. > > Here's a sample of the resulting gdb.sum diff: > > [...] > -PASS: gdb.base/commands.exp: break factorial #3 > -PASS: gdb.base/commands.exp: set value to 5 in > test_command_prompt_position > -PASS: gdb.base/commands.exp: if test in test_command_prompt_position > -PASS: gdb.base/commands.exp: > OK in test_command_prompt_position > +PASS: gdb.base/commands.exp: test_command_prompt_position: break > factorial > +PASS: gdb.base/commands.exp: test_command_prompt_position: set value > to 5 > +PASS: gdb.base/commands.exp: test_command_prompt_position: if test > +PASS: gdb.base/commands.exp: test_command_prompt_position: > OK > [...] LGTM. I think it's acceptable to use the proc name as a prefix in this case. If you take care of choosing a good proc name, what you would pass manually to with_test_prefix otherwise would be basically the proc name without underscores ("test_command_prompt_position" vs "test command prompt position"). It can save some typing and indentation. I'll send a patch that makes gdb.mi/user-selected-context-sync.exp use this new feature. Thanks! Simon