From: Lancelot SIX Date: Sun, 21 Nov 2021 15:34:09 +0000 (+0000) Subject: gdb/testsuite: Remove duplicates from gdb.base/nested-subp2.exp X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c6336a6db001c10383376b762262ca8f953d65c2;p=binutils-gdb.git gdb/testsuite: Remove duplicates from gdb.base/nested-subp2.exp When running the testsuite, I have: Running .../gdb/testsuite/gdb.base/nested-subp2.exp ... DUPLICATE: gdb.base/nested-subp2.exp: continue to the STOP marker DUPLICATE: gdb.base/nested-subp2.exp: print c DUPLICATE: gdb.base/nested-subp2.exp: print count Fix by using with_test_prefix to differentiate the test that are performed at different points during the execution of the debuggee. Tested on x86_64-linux. --- diff --git a/gdb/testsuite/gdb.base/nested-subp2.exp b/gdb/testsuite/gdb.base/nested-subp2.exp index 3a187a53c4b..876b797e49d 100644 --- a/gdb/testsuite/gdb.base/nested-subp2.exp +++ b/gdb/testsuite/gdb.base/nested-subp2.exp @@ -49,21 +49,23 @@ set bp_location [gdb_get_line_number "STOP" "${testcase}.c"] gdb_test "break ${testcase}.c:${bp_location}" \ "Breakpoint \[0-9\]+ at 0x\[0-9a-fA-F\]+: .*" \ "breakpoint to the STOP marker" -gdb_test "continue" \ - "Breakpoint \[0-9\]+, increment .*" \ - "continue to the STOP marker" +with_test_prefix "stop at first iteration" { + gdb_test "continue" \ + "Breakpoint \[0-9\]+, increment .*" \ + "continue to the STOP marker" -# Check we get correct values for both local and non-local variable references. - -gdb_test "print c" "102 'f'" -gdb_test "print count" "0" + # Check we get correct values for both local and non-local variable references. + gdb_test "print c" "102 'f'" + gdb_test "print count" "0" +} # Same but a little later: make sure we were looking at the proper places. - -gdb_test "continue" \ - "Breakpoint \[0-9\]+, increment .*" \ - "continue to the STOP marker" -gdb_test "print c" "111 'o'" -gdb_test "print count" "1" +with_test_prefix "stop at second iteration" { + gdb_test "continue" \ + "Breakpoint \[0-9\]+, increment .*" \ + "continue to the STOP marker" + gdb_test "print c" "111 'o'" + gdb_test "print count" "1" +}