public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Lancelot SIX <lsix@lancelotsix.com>
To: Pedro Alves <pedro@palves.net>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 04/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-catch-load.exp
Date: Thu, 16 Dec 2021 23:27:11 +0000	[thread overview]
Message-ID: <20211216232711.oke7xqfsvfn44wk4@Plymouth> (raw)
In-Reply-To: <882b90a8-a819-4bd5-1e51-fa1cd408ed4d@palves.net>

> > +with_test_prefix "test -catch-load" {
> 
> Can you drop the "test" from this?  These are all tests, so word like "test" and "check" are redundant.
> 

Done

> > +		"catch-load: auto-solib-add on"
> 
> 
> Given the prefix, this manual "catch-load:" prefix is now redundant.
> 

Done

> 
> While at it, could you move the "(timeout)" to the end?  Like:
> 
> 	    fail "catch-unload: solib-event stop (timeout)"

Done.

Thanks for the review.  Bellow is the new version of the patch.

Lancelot.

---
From 6fcb1d880bf5009aa9ce9e873a5c5f50e6fc142d Mon Sep 17 00:00:00 2001
From: Lancelot SIX <lsix@lancelotsix.com>
Date: Mon, 22 Nov 2021 22:36:47 +0000
Subject: [PATCH] gdb/testsuite: Remove duplicates from
 gdb.mi/mi-catch-load.exp

When I run the testsuite, I have:

    Running .../gdb/testsuite/gdb.mi/mi-catch-load.exp ...
    DUPLICATE: gdb.mi/mi-catch-load.exp: breakpoint at main
    DUPLICATE: gdb.mi/mi-catch-load.exp: mi runto main

Fix by grouping the various phases in with_test_prefix blocks.  Since
the tests now have a prefix, remove the manually written prefixes in
testnames.

Also change some messages with the pattern "(timeout) $testname" into
"$estname (timeout)" since tools will handle this as $testname[1] (which
is what we want in this particular scenario).

Tested on x86_64-linux.

[1] https://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Do_not_use_.22tail_parentheses.22_on_test_messages
---
 gdb/testsuite/gdb.mi/mi-catch-load.exp | 77 ++++++++++++++------------
 1 file changed, 41 insertions(+), 36 deletions(-)

diff --git a/gdb/testsuite/gdb.mi/mi-catch-load.exp b/gdb/testsuite/gdb.mi/mi-catch-load.exp
index cbd3967f47a..b55b1ccf715 100644
--- a/gdb/testsuite/gdb.mi/mi-catch-load.exp
+++ b/gdb/testsuite/gdb.mi/mi-catch-load.exp
@@ -40,48 +40,53 @@ if { [gdb_compile_shlib "${srcdir}/${subdir}/${srcfile2}" ${binfile2} {debug}] !
     return -1
 }
 
-mi_clean_restart $binfile
-mi_runto_main
-
 # test -catch-load
-mi_gdb_test "111-gdb-set auto-solib-add on" "111\\^done" "catch-load: auto-solib-add on"
-mi_gdb_test "222-catch-load -t mi-catch-load-so.so*" \
-    "222\\^done,bkpt=\{number=\"2\",type=\"catchpoint\",disp=\"del\",enabled=\"y\",what=\"load of library matching mi-catch-load-so\.so\\*\",catch-type=\"load\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\}" \
-    "catch-load: catch load"
-mi_send_resuming_command "exec-continue" "catch-load: continue"
+with_test_prefix "catch-load" {
+    mi_clean_restart $binfile
+    mi_runto_main
 
-gdb_expect {
-    -re "\\*stopped.*reason=\"solib-event\".*added=.*\r\n.*\r\n$mi_gdb_prompt$" {
-        pass "catch-load: solib-event stop"
-    }
-    -re ".*$mi_gdb_prompt$" {
-	setup_kfail mi/15945 *-*-*mingw*
-        fail "catch-load: solib-event stop"
-    }
-    timeout {
-        fail "(timeout) catch-load: solib-event stop"
+    mi_gdb_test "111-gdb-set auto-solib-add on" "111\\^done" \
+		"auto-solib-add on"
+    mi_gdb_test "222-catch-load -t mi-catch-load-so.so*" \
+		"222\\^done,bkpt=\{number=\"2\",type=\"catchpoint\",disp=\"del\",enabled=\"y\",what=\"load of library matching mi-catch-load-so\.so\\*\",catch-type=\"load\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\}" \
+		"catch load"
+    mi_send_resuming_command "exec-continue" "continue"
+
+    gdb_expect {
+	-re "\\*stopped.*reason=\"solib-event\".*added=.*\r\n.*\r\n$mi_gdb_prompt$" {
+	    pass "solib-event stop"
+	}
+	-re ".*$mi_gdb_prompt$" {
+	    setup_kfail mi/15945 *-*-*mingw*
+	    fail "solib-event stop"
+	}
+	timeout {
+	    fail "solib-event stop (timeout)"
+	}
     }
 }
 
-mi_clean_restart $binfile
-mi_runto_main
-
 # test -catch-unload
-mi_gdb_test "111-gdb-set auto-solib-add on" "111\\^done" "catch-unload: auto-solib-add on"
-mi_gdb_test "222-catch-unload -t mi-catch-load-so.so*" \
-    "222\\^done,bkpt=\{number=\"2\",type=\"catchpoint\",disp=\"del\",enabled=\"y\",what=\"unload of library matching mi-catch-load-so\.so\\*\",catch-type=\"unload\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\}" \
-    "catch-unload: catch unload"
-mi_send_resuming_command "exec-continue" "catch-unload: continue"
+with_test_prefix "catch-unload" {
+    mi_clean_restart $binfile
+    mi_runto_main
 
-gdb_expect {
-    -re "\\*stopped.*reason=\"solib-event\".*removed=.*\r\n.*\r\n$mi_gdb_prompt$" {
-        pass "catch-unload: solib-event stop"
-    }
-    -re ".*$mi_gdb_prompt$" {
-	setup_kfail mi/15945 *-*-*mingw*
-        fail "catch-unload: solib-event stop"
-    }
-    timeout {
-        fail "(timeout) catch-unload: solib-event stop"
+    mi_gdb_test "111-gdb-set auto-solib-add on" "111\\^done" "auto-solib-add on"
+    mi_gdb_test "222-catch-unload -t mi-catch-load-so.so*" \
+		"222\\^done,bkpt=\{number=\"2\",type=\"catchpoint\",disp=\"del\",enabled=\"y\",what=\"unload of library matching mi-catch-load-so\.so\\*\",catch-type=\"unload\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\}" \
+		"catch unload"
+    mi_send_resuming_command "exec-continue" "continue"
+
+    gdb_expect {
+	-re "\\*stopped.*reason=\"solib-event\".*removed=.*\r\n.*\r\n$mi_gdb_prompt$" {
+	    pass "solib-event stop"
+	}
+	-re ".*$mi_gdb_prompt$" {
+	    setup_kfail mi/15945 *-*-*mingw*
+	    fail "solib-event stop"
+	}
+	timeout {
+	    fail "solib-event stop (timeout)"
+	}
     }
 }
-- 
2.34.0


  reply	other threads:[~2021-12-16 23:27 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-26 23:00 [PATCH 00/12] Remove DUPLICATEs warnings Lancelot SIX
2021-11-26 23:00 ` [PATCH 01/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-syn-frame.exp Lancelot SIX
2021-11-26 23:00 ` [PATCH 02/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-nsthrexec.exp Lancelot SIX
2021-11-26 23:00 ` [PATCH 03/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-watch.exp Lancelot SIX
2021-11-26 23:00 ` [PATCH 04/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-catch-load.exp Lancelot SIX
2021-12-10 21:55   ` Pedro Alves
2021-12-16 23:27     ` Lancelot SIX [this message]
2021-12-17 12:21       ` Pedro Alves
2021-11-26 23:00 ` [PATCH 05/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-var-child.exp Lancelot SIX
2021-12-10 21:55   ` Pedro Alves
2021-12-16 23:40     ` Lancelot SIX
2021-12-17 13:00       ` [PATCH] gdb/testsuite: Remove some duplication " Pedro Alves
2021-12-17 23:24         ` Lancelot SIX
2022-01-06 16:44           ` Pedro Alves
2021-11-26 23:00 ` [PATCH 06/12] gdb/testsuite: Remove duplicates from gdb.mi/mi2-var-child.exp Lancelot SIX
2021-11-26 23:00 ` [PATCH 07/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-nonstop.exp Lancelot SIX
2021-11-26 23:00 ` [PATCH 08/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-nonstop-exit.exp Lancelot SIX
2021-12-10 21:56   ` Pedro Alves
2021-12-16 23:48     ` Lancelot SIX
2021-12-17 13:52       ` Pedro Alves
2021-11-26 23:00 ` [PATCH 09/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-var-rtti.exp Lancelot SIX
2021-11-26 23:00 ` [PATCH 10/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-language.exp Lancelot SIX
2021-12-10 21:56   ` Pedro Alves
2021-12-16 23:59     ` Lancelot SIX
2021-12-17 13:53       ` Pedro Alves
2021-11-26 23:00 ` [PATCH 11/12] gdb/testsuite: Remove duplicates from gdb.mi/mi2-amd64-entry-value.exp Lancelot SIX
2021-12-10 21:56   ` Pedro Alves
2021-12-17 22:57     ` Lancelot SIX
2022-01-06 16:49       ` Pedro Alves
2021-11-26 23:00 ` [PATCH 12/12] gdb/testsuite: Remove duplicates from gdb.threads/staticthreads.ex Lancelot SIX
2021-12-09 18:15 ` [PATCH 00/12] Remove DUPLICATEs warnings Tom Tromey
2021-12-10 22:01 ` Pedro Alves
2022-01-07 22:43 ` Lancelot SIX

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211216232711.oke7xqfsvfn44wk4@Plymouth \
    --to=lsix@lancelotsix.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@palves.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).