From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id d69WBdMouWEJGQAAWB0awg (envelope-from ) for ; Tue, 14 Dec 2021 18:29:23 -0500 Received: by simark.ca (Postfix, from userid 112) id 02D8E1F0D2; Tue, 14 Dec 2021 18:29:23 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 4D88D1F0BD for ; Tue, 14 Dec 2021 18:29:22 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8A5533858407 for ; Tue, 14 Dec 2021 23:29:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8A5533858407 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1639524561; bh=I8yGKoQBcbK037eHypCRrRHbrXHdCtCBWpuhspB9GaE=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Sfk6tCzUJgB64Eo5OfUHncNCEydzOHh3ScxYLvOEeFL4vbIiEA5BM+w57c25VvnSL eqXC/2Rgy/LvsVhcy9FQXwNmq4JUu+Nx1/b9Qw/h86o3u+UvaEzWIaH2ahmOEhd8PJ 4CTWdlsYRJDniaVrgeBZC9BXO/DtvGMnxo8Bm8Hc= Received: from lndn.lancelotsix.com (vps-42846194.vps.ovh.net [IPv6:2001:41d0:801:2000::2400]) by sourceware.org (Postfix) with ESMTPS id 8104E3858D28 for ; Tue, 14 Dec 2021 23:29:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8104E3858D28 Received: from Plymouth (unknown [IPv6:2a02:390:9086:0:c851:d496:b69a:1c3c]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id CF0CE80D5D; Tue, 14 Dec 2021 23:28:59 +0000 (UTC) Date: Tue, 14 Dec 2021 23:28:55 +0000 To: Pedro Alves Subject: Re: [PATCH 02/29] gdb/testsuite: Remove duplicates from gdb.base/miscexprs.exp Message-ID: <20211214232855.hooqlyebu34bbczg@Plymouth> References: <20211121175636.779325-1-lsix@lancelotsix.com> <20211121175636.779325-3-lsix@lancelotsix.com> <1e3bc3bb-9e6a-e6e8-11fa-73719977ba47@palves.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1e3bc3bb-9e6a-e6e8-11fa-73719977ba47@palves.net> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Tue, 14 Dec 2021 23:28:59 +0000 (UTC) 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: , From: Lancelot SIX via Gdb-patches Reply-To: Lancelot SIX Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" > > Can you just drop the explicit names instead? > > That's the actual problem, the duplication, and > us humans failing at it. Removing the duplication nips the problem in the bud, so it doesn't > ever happen again if someone adds more tests. > > So we'd just have: > > gdb_test "print sbig.s\[90\] * 10" " = 2550" > > etc. > > We lose the "value of" part but that seems harmless. Hi, Indeed, the exp file is much cleaner after removing the smewhat useless explicit test names (but the patch itself is longer). I have replaced this patch locally with the following. Thanks for the feedback. Best, Lancelot. --- >From 986d73aab7c604033b98ca8c0bbd472ae92ada66 Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Fri, 19 Nov 2021 19:05:37 +0000 Subject: [PATCH] gdb/testsuite: Remove duplicates from gdb.base/miscexprs.exp When running the testsuite I see: Running .../gdb/testsuite/gdb.base/miscexprs.exp ... DUPLICATE: gdb.base/miscexprs.exp: print value of !ibig.i[100] DUPLICATE: gdb.base/miscexprs.exp: print value of !ibig.i[100] This is due to an explicit test name repeated across multiple tests. The actual test explicit names do not add much over the command from wich default test names are derived. Fix by removing the explicit test names across the file where they do not add value. While at doing some cleaning, also use $gdb_test_name in the various uses of gdb_test_multiple. Tested on x86_64-linux. --- gdb/testsuite/gdb.base/miscexprs.exp | 73 +++++++++++----------------- 1 file changed, 28 insertions(+), 45 deletions(-) diff --git a/gdb/testsuite/gdb.base/miscexprs.exp b/gdb/testsuite/gdb.base/miscexprs.exp index 86f41215283..dd67d05e9e5 100644 --- a/gdb/testsuite/gdb.base/miscexprs.exp +++ b/gdb/testsuite/gdb.base/miscexprs.exp @@ -69,85 +69,68 @@ gdb_test "up" " main .*" "up from marker1" global hex -gdb_test "print &ibig.i\[0\]" " = \\(int \\*\\) $hex" \ - "print value of &ibig.i\[0\]" +gdb_test "print &ibig.i\[0\]" " = \\(int \\*\\) $hex" -gdb_test_multiple "print &cbig.c\[0\]" "print value of &cbig.c\[0\]" { +gdb_test_multiple "print &cbig.c\[0\]" "" { -re ".\[0-9\]* = $hex \"\".*$gdb_prompt $" { - pass "print value of &cbig.c\[0\]" + pass $gdb_test_name } -re ".\[0-9\]* = $hex \"*\".*$gdb_prompt $" { - pass "print value of &cbig.c\[0\]" + pass $gdb_test_name } } -gdb_test "print &fbig.f\[0\]" " = \\(float \\*\\) $hex" \ - "print value of &fbig.f\[0\]" +gdb_test "print &fbig.f\[0\]" " = \\(float \\*\\) $hex" -gdb_test "print &dbig.d\[0\]" " = \\(double \\*\\) $hex" \ - "print value of &dbig.d\[0\]" +gdb_test "print &dbig.d\[0\]" " = \\(double \\*\\) $hex" -gdb_test_multiple "print &sbig.s\[0\]" "print value of &sbig.s\[0\]" { +gdb_test_multiple "print &sbig.s\[0\]" "" { -re ".\[0-9\]* = \\(short \\*\\) $hex.*$gdb_prompt $" { - pass "print value of &sbig.s\[0\]" + pass $gdb_test_name } -re ".\[0-9\]* = \\(short int \\*\\) $hex.*$gdb_prompt $" { - pass "print value of &sbig.s\[0\]" + pass $gdb_test_name } } -gdb_test_multiple "print &lbig.l\[0\]" "print value of &lbig.l\[0\]" { +gdb_test_multiple "print &lbig.l\[0\]" "" { -re ".\[0-9\]* = \\(long \\*\\) $hex.*$gdb_prompt $" { - pass "print value of &lbig.l\[0\]" + pass $gdb_test_name } -re ".\[0-9\]* = \\(long int \\*\\) $hex.*$gdb_prompt $" { - pass "print value of &lbig.l\[0\]" + pass $gdb_test_name } } -gdb_test "print ibig.i\[100\] | 1" " = 5" \ - "print value of ibig.i\[100\] | 1" +gdb_test "print ibig.i\[100\] | 1" " = 5" -gdb_test "print sbig.s\[90\] & 127" " = 127" \ - "print value of sbig.s\[90\] & 127" +gdb_test "print sbig.s\[90\] & 127" " = 127" -gdb_test "print !ibig.i\[100\]" " = $false" \ - "print value of !ibig.i\[100\]" +gdb_test "print !ibig.i\[100\]" " = $false" -gdb_test "print !sbig.s\[90\]" " = $false" \ - "print value of !sbig.s\[90\]" +gdb_test "print !sbig.s\[90\]" " = $false" -gdb_test "print !fbig.f\[100\]" " = $false" \ - "print value of !ibig.i\[100\]" +gdb_test "print !fbig.f\[100\]" " = $false" -gdb_test "print !dbig.d\[202\]" " = $false" \ - "print value of !ibig.i\[100\]" +gdb_test "print !dbig.d\[202\]" " = $false" -gdb_test "print sbig.s\[90\] * 10" " = 2550" \ - "print value of !sbig.s\[90\] * 10" +gdb_test "print sbig.s\[90\] * 10" " = 2550" -gdb_test "print ibig.i\[100\] * sbig.s\[90\]" " = 1275" \ - "print value of ibig.i\[100\] * sbig.s\[90\]" +gdb_test "print ibig.i\[100\] * sbig.s\[90\]" " = 1275" -gdb_test "print fbig.f\[100\] * dbig.d\[202\]" " = 119.99\[0-9\]*" \ - "print value of fbig.f\[100\] * dbig.d\[202\]" +gdb_test "print fbig.f\[100\] * dbig.d\[202\]" " = 119.99\[0-9\]*" -gdb_test "print !(sbig.s\[90\] * 2)" " = $false" \ - "print value of !(sbig.s\[90\] * 2)" +gdb_test "print !(sbig.s\[90\] * 2)" " = $false" -gdb_test "print sizeof(sbig)" " = 800" "print value of sizeof sbig" +gdb_test "print sizeof(sbig)" " = 800" -gdb_test "print sizeof(cbig)" " = 100" "print value of sizeof cbig" +gdb_test "print sizeof(cbig)" " = 100" -gdb_test "print sizeof(lbig)/sizeof(long)" " = 900" \ - "print value of sizeof lbig / sizeof long" +gdb_test "print sizeof(lbig)/sizeof(long)" " = 900" -gdb_test "print ibig.i\[100\] << 2" " = 20" \ - "print value of ibig.i\[100\] << 2" +gdb_test "print ibig.i\[100\] << 2" " = 20" -gdb_test "print sbig.s\[90\] >> 4" " = 15" \ - "print value of sbig.s\[90\] >> 4" +gdb_test "print sbig.s\[90\] >> 4" " = 15" -gdb_test "print lbig.l\[333\] >> 6" " = 15624999" \ - "print value of lbig.l\[333\] >> 6" +gdb_test "print lbig.l\[333\] >> 6" " = 15624999" -- 2.34.0