From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 9FB35385DC0A for ; Wed, 29 Apr 2020 14:52:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9FB35385DC0A X-ASG-Debug-ID: 1588171932-0c856e314b5c3800001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id EOHbHlnapBJUkFRd (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 29 Apr 2020 10:52:12 -0400 (EDT) X-Barracuda-Envelope-From: simon.marchi@efficios.com X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from smarchi-efficios.lan (unknown [192.222.164.54]) by smtp.ebox.ca (Postfix) with ESMTP id 448AC441B21; Wed, 29 Apr 2020 10:52:12 -0400 (EDT) From: Simon Marchi X-Barracuda-Effective-Source-IP: 192-222-164-54.qc.cable.ebox.net[192.222.164.54] X-Barracuda-Apparent-Source-IP: 192.222.164.54 X-Barracuda-RBL-IP: 192.222.164.54 To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH] gdb: fix duplicate test names in gdb.base/break.exp Date: Wed, 29 Apr 2020 10:52:11 -0400 X-ASG-Orig-Subj: [PATCH] gdb: fix duplicate test names in gdb.base/break.exp Message-Id: <20200429145211.3437388-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1588171932 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 6042 X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.81513 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-37.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, 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, 29 Apr 2020 14:52:15 -0000 These test names are duplicated: 2 PASS: gdb.base/break.exp: set breakpoint via non-integer convenience variable disallowed 2 PASS: gdb.base/break.exp: set convenience variable $foo to 81.5 Wrap them with `with_test_prefix`. I've actually wrapped a bit more tests that are related, I think it helps to give the test names a bit more context. The modified test names are: -PASS: gdb.base/break.exp: set convenience variable $foo to bp_location11 -PASS: gdb.base/break.exp: set breakpoint via convenience variable -PASS: gdb.base/break.exp: set convenience variable $foo to 81.5 -PASS: gdb.base/break.exp: set breakpoint via non-integer convenience variable disallowed +PASS: gdb.base/break.exp: set line breakpoint via convenience variable: set convenience variable $foo to bp_location11 +PASS: gdb.base/break.exp: set line breakpoint via convenience variable: break $foo +PASS: gdb.base/break.exp: set line breakpoint via convenience variable: set convenience variable $foo to 81.5 +PASS: gdb.base/break.exp: set line breakpoint via convenience variable: non-integer convenience variable disallowed -PASS: gdb.base/break.exp: set $l = 47 -PASS: gdb.base/break.exp: break break.c:$l -PASS: gdb.base/break.exp: set convenience variable $foo to 81.5 -PASS: gdb.base/break.exp: set breakpoint via non-integer convenience variable disallowed +PASS: gdb.base/break.exp: set line:file breakpoint via convenience variable: set $l = 47 +PASS: gdb.base/break.exp: set line:file breakpoint via convenience variable: break break.c:$l +PASS: gdb.base/break.exp: set line:file breakpoint via convenience variable: set convenience variable $foo to 81.5 +PASS: gdb.base/break.exp: set line:file breakpoint via convenience variable: non-integer convenience variable disallowed gdb/testsuite/ChangeLog: * gdb.base/break.exp: Use with_test_prefix. --- gdb/testsuite/gdb.base/break.exp | 73 +++++++++++++++++--------------- 1 file changed, 39 insertions(+), 34 deletions(-) diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp index 67cc8a7a26d4..d2121c3d635e 100644 --- a/gdb/testsuite/gdb.base/break.exp +++ b/gdb/testsuite/gdb.base/break.exp @@ -583,22 +583,25 @@ gdb_test "clear marker3" {Deleted breakpoints [0-9]+ [0-9]+.*} # Verify that a breakpoint can be set via a convenience variable. # -gdb_test_no_output "set \$foo=$bp_location11" \ - "set convenience variable \$foo to bp_location11" -gdb_test "break \$foo" \ - "Breakpoint (\[0-9\]*) at .*, line $bp_location11.*" \ - "set breakpoint via convenience variable" +with_test_prefix "set line breakpoint via convenience variable" { + gdb_test_no_output "set \$foo=$bp_location11" \ + "set convenience variable \$foo to bp_location11" -# Verify that GDB responds gracefully to an attempt to set a -# breakpoint via a convenience variable whose type is not integer. -# -gdb_test_no_output "set \$foo=81.5" \ - "set convenience variable \$foo to 81.5" + gdb_test "break \$foo" \ + "Breakpoint (\[0-9\]*) at .*, line $bp_location11.*" + + # Verify that GDB responds gracefully to an attempt to set a + # breakpoint via a convenience variable whose type is not integer. + # -gdb_test "break \$foo" \ - "Convenience variables used in line specs must have integer values.*" \ - "set breakpoint via non-integer convenience variable disallowed" + gdb_test_no_output "set \$foo=81.5" \ + "set convenience variable \$foo to 81.5" + + gdb_test "break \$foo" \ + "Convenience variables used in line specs must have integer values.*" \ + "non-integer convenience variable disallowed" +} # Verify that we can set and trigger a breakpoint in a user-called function. # @@ -845,29 +848,31 @@ gdb_test_multiple "" $test { # # Test break via convenience variable with file name # -set line [gdb_get_line_number "set breakpoint 1 here"] -gdb_test_no_output "set \$l = $line" - -set line_actual "-1" -set test "break ${srcfile}:\$l" -gdb_test_multiple "$test" $test { - -re "Breakpoint $decimal at $hex: file .*break\\.c, line ($decimal)\\.\r\n$gdb_prompt $" { - # Save the actual line number on which the breakpoint was - # actually set. On some systems (Eg: Ubuntu 16.04 with GCC - # version 5.4.0), that line gets completely inlined, including - # the call to printf, and so we end up inserting the breakpoint - # on one of the following lines instead. - set line_actual $expect_out(1,string) - pass $test - } -} -gdb_test_no_output "set \$foo=81.5" \ - "set convenience variable \$foo to 81.5" -gdb_test "break $srcfile:\$foo" \ - "Convenience variables used in line specs must have integer values.*" \ - "set breakpoint via non-integer convenience variable disallowed" +with_test_prefix "set line:file breakpoint via convenience variable" { + set line [gdb_get_line_number "set breakpoint 1 here"] + gdb_test_no_output "set \$l = $line" + + set line_actual "-1" + set test "break ${srcfile}:\$l" + gdb_test_multiple "$test" $test { + -re "Breakpoint $decimal at $hex: file .*break\\.c, line ($decimal)\\.\r\n$gdb_prompt $" { + # Save the actual line number on which the breakpoint was + # actually set. On some systems (Eg: Ubuntu 16.04 with GCC + # version 5.4.0), that line gets completely inlined, including + # the call to printf, and so we end up inserting the breakpoint + # on one of the following lines instead. + set line_actual $expect_out(1,string) + pass $test + } + } + gdb_test_no_output "set \$foo=81.5" \ + "set convenience variable \$foo to 81.5" + gdb_test "break $srcfile:\$foo" \ + "Convenience variables used in line specs must have integer values.*" \ + "non-integer convenience variable disallowed" +} # # Test that commands can be cleared without error. -- 2.26.2