From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 2BD39393C8B0 for ; Tue, 23 Jun 2020 21:56:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2BD39393C8B0 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id C0C211E792; Tue, 23 Jun 2020 17:56:03 -0400 (EDT) Subject: Re: [RFA] Make test names unique in python.exp and guile.exp To: Pedro Alves , Philippe Waroquiers , gdb-patches@sourceware.org References: <20200623205159.23461-1-philippe.waroquiers@skynet.be> From: Simon Marchi Message-ID: Date: Tue, 23 Jun 2020 17:56:03 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, 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: Tue, 23 Jun 2020 21:56:06 -0000 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 ? Simon