* [PATCH] gdb: fix duplicate test names in gdb.base/break.exp
@ 2020-04-29 14:52 Simon Marchi
2020-04-29 20:14 ` Tom Tromey
0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi @ 2020-04-29 14:52 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] gdb: fix duplicate test names in gdb.base/break.exp
2020-04-29 14:52 [PATCH] gdb: fix duplicate test names in gdb.base/break.exp Simon Marchi
@ 2020-04-29 20:14 ` Tom Tromey
2020-04-29 20:35 ` Simon Marchi
0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2020-04-29 20:14 UTC (permalink / raw)
To: Simon Marchi via Gdb-patches; +Cc: Simon Marchi
>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
Simon> These test names are duplicated:
Simon> 2 PASS: gdb.base/break.exp: set breakpoint via non-integer convenience variable disallowed
Simon> 2 PASS: gdb.base/break.exp: set convenience variable $foo to 81.5
Simon> Wrap them with `with_test_prefix`. I've actually wrapped a bit more
Simon> tests that are related, I think it helps to give the test names a bit
Simon> more context. The modified test names are:
Seems like a good idea to me.
Thanks.
Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gdb: fix duplicate test names in gdb.base/break.exp
2020-04-29 20:14 ` Tom Tromey
@ 2020-04-29 20:35 ` Simon Marchi
0 siblings, 0 replies; 3+ messages in thread
From: Simon Marchi @ 2020-04-29 20:35 UTC (permalink / raw)
To: Tom Tromey, Simon Marchi via Gdb-patches; +Cc: Simon Marchi
On 2020-04-29 4:14 p.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
>
> Simon> These test names are duplicated:
> Simon> 2 PASS: gdb.base/break.exp: set breakpoint via non-integer convenience variable disallowed
> Simon> 2 PASS: gdb.base/break.exp: set convenience variable $foo to 81.5
>
> Simon> Wrap them with `with_test_prefix`. I've actually wrapped a bit more
> Simon> tests that are related, I think it helps to give the test names a bit
> Simon> more context. The modified test names are:
>
> Seems like a good idea to me.
> Thanks.
>
> Tom
>
Thanks, I pushed it.
Simon
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-04-29 20:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29 14:52 [PATCH] gdb: fix duplicate test names in gdb.base/break.exp Simon Marchi
2020-04-29 20:14 ` Tom Tromey
2020-04-29 20:35 ` Simon Marchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox