From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lndn.lancelotsix.com (lndn.lancelotsix.com [51.195.220.111]) by sourceware.org (Postfix) with ESMTPS id 186883858D35 for ; Thu, 16 Dec 2021 23:27:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 186883858D35 Received: from Plymouth (unknown [IPv6:2a02:390:9086:0:7c27:fcf5:8e6d:c1bd]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id 4039A80D5D; Thu, 16 Dec 2021 23:27:14 +0000 (UTC) Date: Thu, 16 Dec 2021 23:27:11 +0000 From: Lancelot SIX To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 04/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-catch-load.exp Message-ID: <20211216232711.oke7xqfsvfn44wk4@Plymouth> References: <20211126230038.103225-1-lsix@lancelotsix.com> <20211126230038.103225-5-lsix@lancelotsix.com> <882b90a8-a819-4bd5-1e51-fa1cd408ed4d@palves.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <882b90a8-a819-4bd5-1e51-fa1cd408ed4d@palves.net> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Thu, 16 Dec 2021 23:27:14 +0000 (UTC) X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2021 23:27:17 -0000 > > +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 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