From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 1FEFB3858C39 for ; Thu, 30 Sep 2021 21:41:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1FEFB3858C39 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 412AB2262F; Thu, 30 Sep 2021 21:41:54 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2668913B5C; Thu, 30 Sep 2021 21:41:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id KvytByIvVmG6TgAAMHmgww (envelope-from ); Thu, 30 Sep 2021 21:41:54 +0000 Subject: Re: [committed][gdb/testsuite] Disable vgdb tests if xml not supported To: Tom Tromey , Tom de Vries via Gdb-patches References: <20210929135520.GA16103@delia> <87pmsq0y4m.fsf@tromey.com> From: Tom de Vries Message-ID: Date: Thu, 30 Sep 2021 23:41:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <87pmsq0y4m.fsf@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, 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, 30 Sep 2021 21:41:58 -0000 On 9/30/21 7:30 PM, Tom Tromey wrote: > Tom> +if { [gdb_skip_xml_test] } { > Tom> + # Valgrind gdbserver requires gdb with xml support. > Tom> + return 0 > Tom> +} > > Do we want/need an 'untested' in there? > Ack, will do. > I wonder if there's a better way to handle these checks, and also > checking for whether compilation succeeded -- that is, remove the > repeated code blocks in favor of some kind of wrapper that uses "return > -code" (but not an exception) to short-circuit the calling .exp file on > failure. Probably a big task though. I suppose we could do in lib/gdb.exp: ... proc require_xml_support {} { if { [gdb_skip_xml_test] } { untested "missing xml support" return -code return 0 } } ... and then in the test-case we're left with the relatively brief: ... require_xml_support ... Or perhaps you mean more generically (which wouldn't require us to write a proc for each type of require): ... proc require { fn val } { if { [$fn] != $val } { untested "$fn != $val" return -code return 0 } } ... and: ... require gdb_skip_xml_test 0 ... ? Thanks, - Tom