From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by sourceware.org (Postfix) with ESMTP id 05A79394442B for ; Tue, 23 Jun 2020 21:43:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 05A79394442B Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-199-NnPNdu9pPDKa-5QRWYzWPg-1; Tue, 23 Jun 2020 17:43:49 -0400 X-MC-Unique: NnPNdu9pPDKa-5QRWYzWPg-1 Received: by mail-wr1-f72.google.com with SMTP id p9so431260wrx.10 for ; Tue, 23 Jun 2020 14:43:48 -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=/f/wGwj1KUp1E4fFSlpPA68IwCcrKneMuZtuf8ToyFs=; b=jFPJ+yJ5gei5oPXV5yWw4DNuQBC9+2OzZBDQWA8cLCoVzqaziUP5X21LOu8O2rZ/G0 4GdPTxT2dUZkQUwA6LFzF89yM2kKxj89mAwqiTn1xEu7perPHbSw2pEwwsK2DPf8eKcm /3CMCbuyqCdYPhaX4XoZ84aXIgj4GpYyUm6XM6UHNxoSUouCJ8AnLdiZG687Dmr7fGIH UU8cPZmIqjyWDHALKPNvHpZyHj6Y9scO6XJHJAdGFf/6uPm2sR/Q4rMFUX0z5uTk8mlE lXREugdO5tI5NtnopeJBO4OJtTnR1xBDe1VriCgPjC9Dw9xHeozFFl7TixbnoJzaYDKA ZV1A== X-Gm-Message-State: AOAM530ezqISgDERk01PEQfIMKSOvTu0+xkLQ6e4nWx0HD1piTL0YmXl owfZVVeJff7pWUYGCMwkupOfLdavzrXJRxG12k4YuVSEQzheRZwiBuGVer2MswB64B2Kivi1Fhm 2MdjO0CgAYmeUb7S7u7sD0w== X-Received: by 2002:a5d:5389:: with SMTP id d9mr28830996wrv.77.1592948627249; Tue, 23 Jun 2020 14:43:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPBjuVjKLEEWwQS3TYjeEumhWZ0pQAAECyGUM5QeyV4Agm4DEKnV0jyctUTYIGgrXJ5DlOyw== X-Received: by 2002:a5d:5389:: with SMTP id d9mr28830973wrv.77.1592948627045; Tue, 23 Jun 2020 14:43:47 -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 f16sm5468454wmh.27.2020.06.23.14.43.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Jun 2020 14:43:46 -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: Date: Tue, 23 Jun 2020 22:43:43 +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: Tue, 23 Jun 2020 21:43:52 -0000 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. There were other cases in the patch that didn't match though. Like: > gdb_test_multiple "python gdb.prompt_hook = prompt" "set the hook" { > -re "\[\r\n\]$newprompt $" { > - pass "set hook" > + pass "set hook prompt" > } > } Here this can result in either: FAIL: set the hook PASS: set hook prompt Pedro Alves