From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by sourceware.org (Postfix) with ESMTP id 64D5E393C88C for ; Wed, 24 Jun 2020 11:28:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 64D5E393C88C Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-318-jNEcXg20PvW9Zbu4qAzW8A-1; Wed, 24 Jun 2020 07:28:07 -0400 X-MC-Unique: jNEcXg20PvW9Zbu4qAzW8A-1 Received: by mail-wr1-f70.google.com with SMTP id z3so2457860wrr.7 for ; Wed, 24 Jun 2020 04:28:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=vpKix50UCTBtigmfv1g4bcnoIVH+3oGoxFI38xlKcog=; b=kvv4R/KTcXpliWMM/pHG0KFJWpAr5q6vZt4LY2cdJVeCKvf2ggsHd0cVEEXK6v2/Ya Pap0gumpYMAjYfVI6rypqC+j1gN81qkiQ8nCoU+jFCHx6atY+4X/kTcKrk0mR7kRDav8 6JFRzpAvC3Rp0c6o5Tr0HGpnXoH+CuniMGZ6VTvb7hkDe24cdyY8bEQXa2YjcQw7e0p4 ga5of2rveHEUuKJFB3qF/LOhYG7/9AxTY3gGrXzIaX5CmoNtJ9hZh2IyOQkaLQzawyNb b/yxnYi/u3F7mAeZOWaZsoSGKzkvsomdP3E/Ugts5tPk9fZrm6VBayQaWz1TOIKiBpRS LqZQ== X-Gm-Message-State: AOAM5313X8txB2xzozwEfb3OOQy2fgl1O/NPknZc55N/tiYDbLCPC1vm 3I8IKcqp7xyERqUb0k0Mhu7JoEEHozu3ek5QLoz/c2i/6kXqTpcNVjmfHLACfpI54iwl4mSFSQg BrqzNjye2laVNWs/H73QIpA== X-Received: by 2002:adf:fe07:: with SMTP id n7mr29693791wrr.240.1592998086362; Wed, 24 Jun 2020 04:28:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3DfmDrW6Vwu7xxaNldMUMZ2d5FV5rkwRjTTgnHHCGp6OKCWKqb1PkA0eeUJv8UMxYE88A5Q== X-Received: by 2002:adf:fe07:: with SMTP id n7mr29693780wrr.240.1592998086144; Wed, 24 Jun 2020 04:28:06 -0700 (PDT) Received: from ?IPv6:2001:8a0:f922:c400:56ee:75ff:fe8d:232b? ([2001:8a0:f922:c400:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id f16sm454044wmf.17.2020.06.24.04.28.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 Jun 2020 04:28:05 -0700 (PDT) Subject: Re: [RFA] Make test names unique in python.exp and guile.exp To: Simon Marchi , Philippe Waroquiers , gdb-patches@sourceware.org References: <20200623205159.23461-1-philippe.waroquiers@skynet.be> From: Pedro Alves Message-ID: <640b5439-c693-8310-0819-2fa75eb09af8@redhat.com> Date: Wed, 24 Jun 2020 12:28:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jun 2020 11:28:10 -0000 On 6/23/20 10:56 PM, Simon Marchi wrote: > On 2020-06-23 5:43 p.m., Pedro Alves wrote: >> On 6/23/20 10:32 PM, Simon Marchi wrote: >>> On 2020-06-23 4:51 p.m., Philippe Waroquiers via Gdb-patches wrote: >>>> + if {[gdb_test_multiple $input "$name - $input" { >>>> + -re "\[\r\n\]*($result)\[\r\n\]+($gdb_prompt | *>)$" { >>>> + pass "$name - $input (input nr $inputnr)" >>> >>> The test name passed as the second argument of `gdb_test_multiple` and the test >>> name passed to `pass` should match. This is why the special variable $gdb_test_name >>> was added, to avoid potential mismatches. You can use "pass $gdb_test_name" inside >>> the gdb_test_multiple body. >> >> Text within the "(xxx)" at the end is considered informational, not >> part of the test name, though. That's why we avoid trailing parens >> in general. So in this case they do match. Just like these match: >> >> PASS: foo >> FAIL: foo (timeout) >> >> Still a good idea to write: >> >> pass "$gdb_test_name (input nr $inputnr)" >> >> though. > > But here we want to use $inputnr to really differentiate the names of > the tests, because $input is a command to execute. So if two commands to > execute are "end", we would end up with > > PASS: something - end (input nr 0) > PASS: something - end (input nr 1) > > which would be wrongfully considered as the same test. So I think we need > inputnr to be part of the test name, not in parenthesis. Maybe > > $name: input $inputnr: $input Hmm, yeah. I didn't realize that command issues a PASS for each of the the lines. That looks good to me. Thanks, Pedro Alves