From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cBkPNaFfP2G+JgAAWB0awg (envelope-from ) for ; Mon, 13 Sep 2021 10:26:41 -0400 Received: by simark.ca (Postfix, from userid 112) id D750F1EDDB; Mon, 13 Sep 2021 10:26:41 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id E379A1EDDB for ; Mon, 13 Sep 2021 10:26:40 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7AD60385781B for ; Mon, 13 Sep 2021 14:26:40 +0000 (GMT) Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id 2ED2D3858C60 for ; Mon, 13 Sep 2021 14:26:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2ED2D3858C60 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wm1-x333.google.com with SMTP id l18-20020a05600c4f1200b002f8cf606262so7150162wmq.1 for ; Mon, 13 Sep 2021 07:26:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Up+kA/lctkD2yrefLDfUpg1qfUFd3iQQWTobIRLhFiU=; b=GWO1ews2SXTkgPpxGFaswnpA+x9kUQRfP5rVcbYKy1p7QvPBmB057VR5KlX3cImcjr DyXnkUyYaWbKxsGaW5OZ49eVX69HM9ro/5VqrSJuFUgNPJUqe49IafEQW0R3RBzQU8eW /Rvhen7bGFcs3OXMDuonnNlpR7UVDZcugdoFwRzH5LS9bp9ybMKPGkOZBsKbjUCHeAMb 5lPruFYNIROR1EDjvi0B+oKxL8TyQ0UQpaHp6P+DRdUIEoSrfmMi2qX516z4CMQEWPEj xo5s94NGdxH2g22FBbau6eRC/Gyn+LDarWFBOtJToldhH+c4bzB/Y+v86XWxQsgDFz0h aPKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Up+kA/lctkD2yrefLDfUpg1qfUFd3iQQWTobIRLhFiU=; b=XjujOuApo37W/B8MSH1C/IuMEt2NPte2motoHngmm96yX60UAjrMl4TWajgumJtOpt hzEFGBaHbqG6JbnbhK78P0EYHtJs1Miabg8f9uNgaz5l4KvgEELldokWEyKnrG7XispX 1u6dqV0FIp/tVVddabGKiww01q2I9+xtLXrIz7IIPt9j1yFUeD+az7HtH5ugC38aszdk 3tRizWBwQJLHv7v/EEwe05+eqsHjoV5E4I8PiYuCdT5ULuKW+ns8yW6s1gm9goueYefC HMd+TwAElvOWtsUn0hEaOnoLkvLAJ5XHPyt4QacDATC6Bjg57Bi12QqluEOE1Wp3iyZ8 LU/w== X-Gm-Message-State: AOAM533TnHs64Ue9GFH8eAJB90OpBzkQMiqwNLzVx41szF4PUATViUfC 3b0m8iDP/CMt8+m4SoOgcFwG0eaqRjMSMg== X-Google-Smtp-Source: ABdhPJy8acwDo4TUQsse3hFBJCy13sxD5qSYOi5Wr5aHCHLS2fCJreiUfhS+nqx0aVegVRMZp5Nc8w== X-Received: by 2002:a05:600c:4f95:: with SMTP id n21mr6918633wmq.22.1631543188258; Mon, 13 Sep 2021 07:26:28 -0700 (PDT) Received: from localhost (host86-153-58-62.range86-153.btcentralplus.com. [86.153.58.62]) by smtp.gmail.com with ESMTPSA id 61sm672024wrl.94.2021.09.13.07.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 07:26:27 -0700 (PDT) Date: Mon, 13 Sep 2021 15:26:27 +0100 From: Andrew Burgess To: Tom de Vries Subject: Re: [PATCH][gdb/testsuite] Check for valid test name Message-ID: <20210913142627.GA61506@embecosm.com> References: <20210913071908.GA3469@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210913071908.GA3469@delia.home> X-Operating-System: Linux/5.8.18-100.fc31.x86_64 (x86_64) X-Uptime: 15:17:15 up 2 days, 4:13, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] 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: , Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" * Tom de Vries via Gdb-patches [2021-09-13 09:19:11 +0200]: > Hi, > > When running gdb.base/batch-exit-status.exp I noticed that the test name > contains a newline: > ... > PASS: gdb.base/batch-exit-status.exp: : No such file or directory\.^M > : No such file or directory\.: [lindex $result 2] == 0 > ... > > Check for this in ::CheckTestNames::check, such that we have a warning: > ... > PASS: gdb.base/batch-exit-status.exp: : No such file or directory\.^M > : No such file or directory\.: [lindex $result 2] == 0 > WARNING: Newline in test name > ... > > Tested on x86_64-linux. > > Any comments? > > Thanks, > - Tom > > [gdb/testsuite] Check for valid test name > > --- > gdb/testsuite/lib/check-test-names.exp | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/gdb/testsuite/lib/check-test-names.exp b/gdb/testsuite/lib/check-test-names.exp > index 1de7624d5c5..db76abab990 100644 > --- a/gdb/testsuite/lib/check-test-names.exp > +++ b/gdb/testsuite/lib/check-test-names.exp > @@ -93,6 +93,13 @@ namespace eval ::CheckTestNames { > return $message > } > > + # Check if MESSAGE is a well-formed test name. > + proc _check_name { message } { I think `_check_newline` would be a better name. > + if { [regexp \n $message]} { > + warning "Newline in test name" > + } If I run the entire testsuite I guess these warnings will likely get lost in the output, unlike the DUPLICATE/PATH warnings, which are listed along with the other PASS/FAIL/etc results. Did you check to see if this warning occurs any other times in the testsuite right now? I guess if we're clean right now then having this as a warning is fine, as we should spot this when adding new tests. I'm happy with this though (with the name change above). Thanks, Andrew > + } > + > # Check if MESSAGE contains either the source path or the build path. > # This will result in test names that can't easily be compared between > # different runs of GDB. > @@ -110,6 +117,8 @@ namespace eval ::CheckTestNames { > if [ _check_duplicates $message ] { > clone_output "DUPLICATE: $message" > } > + > + _check_name $message > } > > # If COUNT is greater than zero, disply PREFIX followed by COUNT.