From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id WPd2AjYSZGGKJAAAWB0awg (envelope-from ) for ; Mon, 11 Oct 2021 06:30:14 -0400 Received: by simark.ca (Postfix, from userid 112) id 086631F3CB; Mon, 11 Oct 2021 06:30:14 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4E34D1E813 for ; Mon, 11 Oct 2021 06:30:13 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0800B385803D for ; Mon, 11 Oct 2021 10:30:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0800B385803D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1633948213; bh=JzahK4aEDYj3olBWkEZpfrGsRWkZOVqxzq9KKqtzjEA=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=hVrfX8AScZpA2Qzjwkl2G2DjjmglsSPOBDfVXykJSpgHWruROmWLajtXCddszspkb D7h8TK+cNJX4+kCfmjUfNkXkIwpWESGvr6yiSOatZmCQp/DjVFKpSGxdYJ4rmhsNKK llM9j//cFrEL1nOCJPulgfRRO4p/K4aVgSX7mRS4= Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id BB8363858024 for ; Mon, 11 Oct 2021 10:29:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BB8363858024 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-out2.suse.de (Postfix) with ESMTPS id 03E4120051 for ; Mon, 11 Oct 2021 10:29:31 +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 DC60013C4C for ; Mon, 11 Oct 2021 10:29:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id xCW4NAoSZGGWOQAAMHmgww (envelope-from ) for ; Mon, 11 Oct 2021 10:29:30 +0000 Date: Mon, 11 Oct 2021 12:29:29 +0200 To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Use require for ensure_gdb_index Message-ID: <20211011102927.GA21678@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) 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: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, Replace: ... if { [ensure_gdb_index $binfile] == -1 } { return -1 } ... with: ... require {ensure_gdb_index $binfile} != -1 ... and consequently, add a missing UNTESTED message. Tested on x86_64-linux, both with native and target board readnow. Committed to trunk. Thanks, - Tom [gdb/testsuite] Use require for ensure_gdb_index --- gdb/testsuite/gdb.base/with-mf.exp | 4 +--- gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp | 4 +--- gdb/testsuite/gdb.dwarf2/gdb-add-index.exp | 4 +--- gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp | 4 +--- gdb/testsuite/gdb.rust/dwindex.exp | 4 +--- gdb/testsuite/lib/gdb.exp | 4 ++++ 6 files changed, 9 insertions(+), 15 deletions(-) diff --git a/gdb/testsuite/gdb.base/with-mf.exp b/gdb/testsuite/gdb.base/with-mf.exp index d0667b31183..a0f5b279f2d 100644 --- a/gdb/testsuite/gdb.base/with-mf.exp +++ b/gdb/testsuite/gdb.base/with-mf.exp @@ -24,9 +24,7 @@ if {[prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" \ return -1 } -if { [ensure_gdb_index $binfile] == -1 } { - return -1 -} +require {ensure_gdb_index $binfile} != -1 clean_restart $binfile diff --git a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp index 74c558ad231..3f09aa8719b 100644 --- a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp +++ b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp @@ -29,9 +29,7 @@ with_test_prefix non-symlink { return -1 } - if { [ensure_gdb_index $binfile] == -1 } { - return -1 - } + require {ensure_gdb_index $binfile} != -1 } # Regenerate exec without index. diff --git a/gdb/testsuite/gdb.dwarf2/gdb-add-index.exp b/gdb/testsuite/gdb.dwarf2/gdb-add-index.exp index 2a83eb1ac23..17c278e8af1 100644 --- a/gdb/testsuite/gdb.dwarf2/gdb-add-index.exp +++ b/gdb/testsuite/gdb.dwarf2/gdb-add-index.exp @@ -27,9 +27,7 @@ if { [prepare_for_testing "failed to prepare" "${testfile}" \ return -1 } -if { [ensure_gdb_index $binfile] == -1 } { - return -1 -} +require {ensure_gdb_index $binfile} != -1 # Ok, we have a copy of $binfile with an index. # Restart gdb and verify the index was used. diff --git a/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp b/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp index 9034f4c0085..b3a7005a834 100644 --- a/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp +++ b/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp @@ -74,9 +74,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \ return -1 } -if { [ensure_gdb_index $binfile] == -1 } { - return -1 -} +require {ensure_gdb_index $binfile} != -1 clean_restart ${binfile} diff --git a/gdb/testsuite/gdb.rust/dwindex.exp b/gdb/testsuite/gdb.rust/dwindex.exp index 1bc61993240..07de0b4b2a5 100644 --- a/gdb/testsuite/gdb.rust/dwindex.exp +++ b/gdb/testsuite/gdb.rust/dwindex.exp @@ -26,9 +26,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} { return -1 } -if {[ensure_gdb_index $binfile "-dwarf-5"] == -1} { - return -1 -} +require {ensure_gdb_index $binfile -dwarf-5} != -1 gdb_exit gdb_start diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index c2e6595f594..90131fe4ee7 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -8247,6 +8247,10 @@ proc require { fn arg1 {arg2 ""} } { switch "$fn $op $val" { "gdb_skip_xml_test == 0" { set msg "missing xml support" } + "ensure_gdb_index $binfile != -1" - + "ensure_gdb_index $binfile -dwarf-5 != -1" { + set msg "Couldn't ensure index in binfile" + } default { set msg "$fn != $val" } }