* [pushed] Fix duplicate tests in gdb.rust
@ 2020-05-19 18:35 Tom Tromey
2020-05-19 19:29 ` Pedro Alves
0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2020-05-19 18:35 UTC (permalink / raw)
To: gdb-patches; +Cc: Tom Tromey
gdb.rust complains about some duplicate test names. This patch fixes
this in a straightforward way.
2020-05-19 Tom Tromey <tromey@adacore.com>
* gdb.rust/simple.exp: Add some test descriptions.
(test_one_slice): Use with_test_prefix.
---
gdb/testsuite/ChangeLog | 5 +++++
gdb/testsuite/gdb.rust/simple.exp | 18 ++++++++++--------
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/gdb/testsuite/gdb.rust/simple.exp b/gdb/testsuite/gdb.rust/simple.exp
index 6daaf8415c5..2653170df31 100644
--- a/gdb/testsuite/gdb.rust/simple.exp
+++ b/gdb/testsuite/gdb.rust/simple.exp
@@ -45,11 +45,11 @@ gdb_test "ptype c" " = i32"
gdb_test "print sizeof(c)" " = 4"
gdb_test "print c = 87" " = \\(\\)"
-gdb_test "print c" " = 87"
+gdb_test "print c" " = 87" "print after assignment"
gdb_test "print c += 3" " = \\(\\)"
-gdb_test "print c" " = 90"
+gdb_test "print c" " = 90" "print after plus assignment"
gdb_test "print c -= 90" " = \\(\\)"
-gdb_test "print c" " = 0"
+gdb_test "print c" " = 0" "print after minus assignment"
gdb_test "print *&c" " = 0"
gdb_test "print *(&c as &i32)" " = 0"
gdb_test "print *(&c as *const i32)" " = 0"
@@ -88,7 +88,7 @@ gdb_test "print w\[2\] @ 2" " = \\\[3, 4\\\]"
gdb_test "print w_ptr\[2\]" " = 3"
gdb_test "print fromslice" " = 3"
gdb_test "print slice\[0\]" " = 3"
-gdb_test "print slice as &\[i32\]\[0\]" " = 3"
+gdb_test "print slice as &\[i32\]\[0\]"
gdb_test_sequence "ptype slice" "" {
" = struct &\\\[i32\\\] \\{"
@@ -289,12 +289,14 @@ gdb_test "print st" \
" = simple::StringAtOffset {field1: \"hello\", field2: 1, field3: \"world\"}"
proc test_one_slice {svar length base range} {
- global hex
+ with_test_prefix $range {
+ global hex
- set result " = &\\\[.*\\\] \\{data_ptr: $hex, length: $length\\}"
+ set result " = &\\\[.*\\\] \\{data_ptr: $hex, length: $length\\}"
- gdb_test "print $svar" $result
- gdb_test "print &${base}\[${range}\]" $result
+ gdb_test "print $svar" $result
+ gdb_test "print &${base}\[${range}\]" $result
+ }
}
test_one_slice slice 1 w 2..3
--
2.21.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [pushed] Fix duplicate tests in gdb.rust
2020-05-19 18:35 [pushed] Fix duplicate tests in gdb.rust Tom Tromey
@ 2020-05-19 19:29 ` Pedro Alves
2020-05-19 19:40 ` Tom Tromey
0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2020-05-19 19:29 UTC (permalink / raw)
To: Tom Tromey, gdb-patches
On 5/19/20 7:35 PM, Tom Tromey wrote:
> @@ -88,7 +88,7 @@ gdb_test "print w\[2\] @ 2" " = \\\[3, 4\\\]"
> gdb_test "print w_ptr\[2\]" " = 3"
> gdb_test "print fromslice" " = 3"
> gdb_test "print slice\[0\]" " = 3"
> -gdb_test "print slice as &\[i32\]\[0\]" " = 3"
> +gdb_test "print slice as &\[i32\]\[0\]"
Was this change intended?
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [pushed] Fix duplicate tests in gdb.rust
2020-05-19 19:29 ` Pedro Alves
@ 2020-05-19 19:40 ` Tom Tromey
0 siblings, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2020-05-19 19:40 UTC (permalink / raw)
To: Pedro Alves; +Cc: Tom Tromey, gdb-patches
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
>> -gdb_test "print slice as &\[i32\]\[0\]" " = 3"
>> +gdb_test "print slice as &\[i32\]\[0\]"
Pedro> Was this change intended?
Crud, no. Will fix.
Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-05-19 19:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19 18:35 [pushed] Fix duplicate tests in gdb.rust Tom Tromey
2020-05-19 19:29 ` Pedro Alves
2020-05-19 19:40 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).