public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb/testsuite: Remove duplicates from gdb.mi/mi-nonstop-exit.exp
@ 2022-01-07 22:47 Lancelot SIX
  0 siblings, 0 replies; only message in thread
From: Lancelot SIX @ 2022-01-07 22:47 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=dd1655dfc3468a8ce43b684e817acedec53f0980

commit dd1655dfc3468a8ce43b684e817acedec53f0980
Author: Lancelot SIX <lsix@lancelotsix.com>
Date:   Tue Nov 23 13:42:13 2021 +0000

    gdb/testsuite: Remove duplicates from gdb.mi/mi-nonstop-exit.exp
    
    When running the testsuite, I have:
    
        Running .../gdb/testsuite/gdb.mi/mi-nonstop-exit.exp ...
        DUPLICATE: gdb.mi/mi-nonstop-exit.exp: breakpoint at main
        DUPLICATE: gdb.mi/mi-nonstop-exit.exp: mi runto main
    
    This test runs the same sequence of operations twice.  Refactor the code
    by running both of those sequences within a foreach_with_prefix block to
    ensure that the commands have unique test names.
    
    Tested on x86_64-linux.

Diff:
---
 gdb/testsuite/gdb.mi/mi-nonstop-exit.exp | 23 +++++++----------------
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp b/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp
index 17e8de5b8bd..9e650b82534 100644
--- a/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp
+++ b/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp
@@ -39,24 +39,15 @@ save_vars { GDBFLAGS } {
 mi_gdb_test "-gdb-set mi-async 1" ".*"
 mi_detect_async
 
-if { [mi_runto_main] < 0 } {
-    continue
-}
-
-mi_send_resuming_command "exec-continue" "continue"
-
-mi_expect_stop "exited-normally" "" "" "" "" "" "finished exec continue"
+foreach_with_prefix iteration {1 2} {
+    mi_delete_breakpoints
+    if { [mi_runto_main] < 0 } {
+        continue
+    }
 
-# Run the program again.
+    mi_send_resuming_command "exec-continue" "continue"
 
-mi_delete_breakpoints
-
-if { [mi_runto_main] < 0 } {
-    continue
+    mi_expect_stop "exited-normally" "" "" "" "" "" "finished exec continue"
 }
 
-mi_send_resuming_command "exec-continue" "continue (2)"
-
-mi_expect_stop "exited-normally" "" "" "" "" "" "finished exec continue (2)"
-
 mi_gdb_exit


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-07 22:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-07 22:47 [binutils-gdb] gdb/testsuite: Remove duplicates from gdb.mi/mi-nonstop-exit.exp 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).