From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 3EC3A388A002 for ; Tue, 22 Feb 2022 14:43:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3EC3A388A002 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 21MEgqqY005278 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Feb 2022 09:42:57 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 21MEgqqY005278 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 86F511F0E7; Tue, 22 Feb 2022 09:42:52 -0500 (EST) Message-ID: Date: Tue, 22 Feb 2022 09:42:52 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v4 1/2] gdb: testsuite: print explicit test result in can_spawn_for_attach() Content-Language: en-US To: Tiezhu Yang , gdb-patches@sourceware.org References: <1645533747-32005-1-git-send-email-yangtiezhu@loongson.cn> <1645533747-32005-2-git-send-email-yangtiezhu@loongson.cn> From: Simon Marchi In-Reply-To: <1645533747-32005-2-git-send-email-yangtiezhu@loongson.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Tue, 22 Feb 2022 14:42:52 +0000 X-Spam-Status: No, score=-3039.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: Tue, 22 Feb 2022 14:43:09 -0000 On 2022-02-22 07:42, Tiezhu Yang wrote: > In the current code, there is no test result when execute the following > commands: > > $ make check-gdb TESTS="gdb.base/attach-pie-noexec.exp" RUNTESTFLAGS="--target_board=remote-gdbserver-on-localhost" > $ make check-gdb TESTS="gdb.base/attach-pie-noexec.exp" RUNTESTFLAGS="--target_board=native-gdbserver" > > It is better to print explicit test result in can_spawn_for_attach(). > > Signed-off-by: Tiezhu Yang It could be that some test uses this procedure not to skip some tests, but to choose between two alternatives. In that case, we wouldn't want to show an "UNTESTED". On the other hand, if you can confirm that all current uses of can_spawn_for_attach are for simply skipping tests, then it's probably fine. To make it non-ambiguous, we could rename can_spawn_for_attach to skip_attach_tests, very similar to the skip_python_tests procedure. Then it would be clear what it is for (skipping attach tests if attach is not supported by the target). And skip_python_tests does show an "UNSUPPORTED" if Python support is disabled, so it would makes sense to do the same for attach. I think that "unsupported" is more accurate than "untested" in this case: https://www.gnu.org/software/dejagnu/manual/untested-procedure.html https://www.gnu.org/software/dejagnu/manual/unsupported-procedure.html > --- > gdb/testsuite/lib/gdb.exp | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp > index a3717a4..d15ab90 100644 > --- a/gdb/testsuite/lib/gdb.exp > +++ b/gdb/testsuite/lib/gdb.exp > @@ -5063,6 +5063,7 @@ proc can_spawn_for_attach { } { > # back the pid of the program. On remote boards, that would give > # us instead the PID of e.g., the ssh client, etc. > if [is_remote target] then { > + untested "skipping tests due to is_remote target" > return 0 > } > > @@ -5070,6 +5071,7 @@ proc can_spawn_for_attach { } { > # stub-like, where GDB finds the program already started on > # initial connection. > if {[target_info exists use_gdb_stub]} { > + untested "skipping tests due to use_gdb_stub" > return 0 > } So I would suggest using: unsupported "skip attach tests (target is remote)" unsupported "skip attach tests (target is stub)" That makes "skipping attach tests" the name of the test (identical in both cases), and the part in parenthesis is additional details. See: https://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Do_not_use_.22tail_parentheses.22_on_test_messages Simon