From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127023 invoked by alias); 1 Oct 2019 17:41:43 -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 127015 invoked by uid 89); 1 Oct 2019 17:41:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=eyes X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 01 Oct 2019 17:41:42 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A023630BD2CB; Tue, 1 Oct 2019 17:41:41 +0000 (UTC) Received: from theo.uglyboxes.com (ovpn-116-199.phx2.redhat.com [10.3.116.199]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6B8E960623; Tue, 1 Oct 2019 17:41:41 +0000 (UTC) Subject: Re: [PATCH] gdb/testsuite: Add gdb_test_multiple_name variable To: Andrew Burgess , gdb-patches References: <20191001172850.29867-1-andrew.burgess@embecosm.com> From: Keith Seitz Message-ID: <83e83e2a-c0f8-5721-ad76-8b842aaad390@redhat.com> Date: Tue, 01 Oct 2019 17:41:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191001172850.29867-1-andrew.burgess@embecosm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-10/txt/msg00025.txt.bz2 On 10/1/19 10:28 AM, Andrew Burgess wrote: > After this patch you can now write this: > > gdb_test_multiple "print foo" "test foo" { > -re "expected output 1" { > pass $gdb_test_multiple_name > } > -re "expected output 2" { > fail $gdb_test_multiple_name > } > } OMG, why didn't *I* think of that!?! > The $gdb_test_multiple_name is setup by gdb_test_multiple, and cleaned > up once the test has completed. Nested calls to gdb_test_multiple are > supported, though $gdb_test_multiple_name will only ever contain the > inner most test message (which is probably what you want). Your patch looks good to me (but I am not a maintainer), but I wanted to ask if you considered using a stack to more robustly solve the nesting problem? It might be unnecessary today -- even overkill -- but I would think it is much easier on the eyes. We have such support in the test suite already. See testsuite/lib/data-structures.exp. [I am not suggesting any changes, just trying to raise awareness for ::Stack et al usage in the test suite.] Keith