public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb/testsuite: prefer gdb_test in gdb.dwarf2/calling-convention
@ 2022-05-25 13:46 Lancelot SIX
  2022-05-25 14:13 ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Lancelot SIX @ 2022-05-25 13:46 UTC (permalink / raw)
  To: gdb-patches; +Cc: lancelot.six, lsix

Since ed01945057c "Make gdb_test's question non-optional if specified",
if the question and response parameters are given to gdb_test, the
framework enforces that GDB asks the question.  Before this patch, tests
needed to use gdb_test_multiple to enforce this.

This patch updates the gdb.dwarf2/calling-convention.exp testcase to use
gdb_test to check that GDB asks a question.  This replaces the more
complicated gdb_test_multiple based implementation.

Tested on x86_64-gnu-linux.

Change-Id: I7216e822ca68f2727e0450970097d74c27c432fe
---
 gdb/testsuite/gdb.dwarf2/calling-convention.exp | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/gdb/testsuite/gdb.dwarf2/calling-convention.exp b/gdb/testsuite/gdb.dwarf2/calling-convention.exp
index 77107a42350..8c87a69ebdf 100644
--- a/gdb/testsuite/gdb.dwarf2/calling-convention.exp
+++ b/gdb/testsuite/gdb.dwarf2/calling-convention.exp
@@ -83,12 +83,14 @@ gdb_test "call foo ()" \
 gdb_breakpoint "foo"
 gdb_continue_to_breakpoint "foo"
 
-gdb_test_multiple "return 35" "" {
-    -re "Function 'foo' does not follow the target calling convention.\r\nIf you continue, setting the return value will probably lead to unpredictable behaviors.\r\nMake foo return now\\? \\(y or n\\) $" {
-	pass $gdb_test_name
-	gdb_test "n" "Not confirmed" "cancel return"
-    }
-}
+gdb_test "return 35" \
+       "Not confirmed" \
+       "return 35" \
+       [multi_line \
+           "Function 'foo' does not follow the target calling convention\\." \
+           "If you continue, setting the return value will probably lead to unpredictable behaviors\\." \
+           "Make foo return now\\? \\(y or n\\) $"] \
+       "n"
 
 gdb_test "finish" [multi_line \
     "Run till exit from #0  $hex in foo \\(\\)" \

base-commit: cce0ae568c7e30e0a7b8d1bd77f8c4b7d7b8ce7b
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gdb/testsuite: prefer gdb_test in gdb.dwarf2/calling-convention
  2022-05-25 13:46 [PATCH] gdb/testsuite: prefer gdb_test in gdb.dwarf2/calling-convention Lancelot SIX
@ 2022-05-25 14:13 ` Pedro Alves
  2022-05-26  8:54   ` Lancelot SIX
  0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2022-05-25 14:13 UTC (permalink / raw)
  To: Lancelot SIX, gdb-patches; +Cc: lsix

On 2022-05-25 14:46, Lancelot SIX via Gdb-patches wrote:
> Since ed01945057c "Make gdb_test's question non-optional if specified",
> if the question and response parameters are given to gdb_test, the
> framework enforces that GDB asks the question.  Before this patch, tests
> needed to use gdb_test_multiple to enforce this.
> 
> This patch updates the gdb.dwarf2/calling-convention.exp testcase to use
> gdb_test to check that GDB asks a question.  This replaces the more
> complicated gdb_test_multiple based implementation.
> 
> Tested on x86_64-gnu-linux.

OK, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gdb/testsuite: prefer gdb_test in gdb.dwarf2/calling-convention
  2022-05-25 14:13 ` Pedro Alves
@ 2022-05-26  8:54   ` Lancelot SIX
  0 siblings, 0 replies; 3+ messages in thread
From: Lancelot SIX @ 2022-05-26  8:54 UTC (permalink / raw)
  To: Pedro Alves, gdb-patches; +Cc: lsix



On 25/05/2022 15:13, Pedro Alves wrote:
> [CAUTION: External Email]
> 
> On 2022-05-25 14:46, Lancelot SIX via Gdb-patches wrote:
>> Since ed01945057c "Make gdb_test's question non-optional if specified",
>> if the question and response parameters are given to gdb_test, the
>> framework enforces that GDB asks the question.  Before this patch, tests
>> needed to use gdb_test_multiple to enforce this.
>>
>> This patch updates the gdb.dwarf2/calling-convention.exp testcase to use
>> gdb_test to check that GDB asks a question.  This replaces the more
>> complicated gdb_test_multiple based implementation.
>>
>> Tested on x86_64-gnu-linux.
> 
> OK, thanks.

Thanks,

Just pushed.

Lancelot.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-26  8:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-25 13:46 [PATCH] gdb/testsuite: prefer gdb_test in gdb.dwarf2/calling-convention Lancelot SIX
2022-05-25 14:13 ` Pedro Alves
2022-05-26  8:54   ` Lancelot SIX

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).