From patchwork Thu Jan 12 03:00:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 63064 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BE31E39428DB for ; Thu, 12 Jan 2023 03:07:50 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from gproxy2-pub.mail.unifiedlayer.com (gproxy2-pub.mail.unifiedlayer.com [69.89.18.3]) by sourceware.org (Postfix) with ESMTPS id 4776E382FADA for ; Thu, 12 Jan 2023 03:01:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4776E382FADA Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from cmgw10.mail.unifiedlayer.com (unknown [10.0.90.125]) by progateway4.mail.pro1.eigbox.com (Postfix) with ESMTP id BD28A100476E3 for ; Thu, 12 Jan 2023 03:01:51 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id FnqhplM5XLXXpFnqhp4ke5; Thu, 12 Jan 2023 03:01:51 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=KvyIZUaN c=1 sm=1 tr=0 ts=63bf781f a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=RvmDmJFTN0MA:10:nop_rcvd_month_year a=Qbun_eYptAEA:10:endurance_base64_authed_username_1 a=7RzCi0huetXWuvAswKsA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=8jbMwWSb5NMeOd58IMpJMYo8SRmsDyaLF+6g1NJoN9g=; b=hfGN4Bp2FpdPXpaJxMWSLAvqUV 0qBvGJSZF/5l4WTnNaE3Hkc+oqyJcg1Kg0KTEd1ckF5qtt+OvmciYPSm+GNEObwCFhl7Pp/iuqzzI Yzf/SSxncZT1TjnwHTObVXwB9; Received: from 97-122-76-186.hlrn.qwest.net ([97.122.76.186]:41092 helo=localhost.localdomain) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pFnqh-000mJw-GY; Wed, 11 Jan 2023 20:01:51 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v2 77/79] Rename to allow_guile_tests Date: Wed, 11 Jan 2023 20:00:50 -0700 Message-Id: <20230112030052.3306113-78-tom@tromey.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230112030052.3306113-1-tom@tromey.com> References: <20230112030052.3306113-1-tom@tromey.com> MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.76.186 X-Source-L: No X-Exim-ID: 1pFnqh-000mJw-GY X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-76-186.hlrn.qwest.net (localhost.localdomain) [97.122.76.186]:41092 X-Source-Auth: tom+tromey.com X-Email-Count: 78 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3028.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" This changes skip_guile_tests to invert the sense, and renames it to allow_guile_tests. It also rewrites this proc to check the output of "gdb --configuration", as was done for Python. Then it changes the code to use "require" where possible. --- gdb/testsuite/gdb.guile/scm-arch.exp | 5 ++--- gdb/testsuite/gdb.guile/scm-block.exp | 5 ++--- gdb/testsuite/gdb.guile/scm-breakpoint.exp | 5 ++--- gdb/testsuite/gdb.guile/scm-cmd.exp | 5 ++--- gdb/testsuite/gdb.guile/scm-disasm.exp | 5 ++--- gdb/testsuite/gdb.guile/scm-equal.exp | 5 ++--- gdb/testsuite/gdb.guile/scm-error.exp | 5 ++--- gdb/testsuite/gdb.guile/scm-frame-args.exp | 5 ++--- gdb/testsuite/gdb.guile/scm-frame-inline.exp | 5 ++--- gdb/testsuite/gdb.guile/scm-frame.exp | 5 ++--- gdb/testsuite/gdb.guile/scm-gsmob.exp | 5 ++--- gdb/testsuite/gdb.guile/scm-iterator.exp | 5 ++--- gdb/testsuite/gdb.guile/scm-lazy-string.exp | 5 ++--- gdb/testsuite/gdb.guile/scm-math.exp | 5 ++--- .../gdb.guile/scm-objfile-script.exp | 5 ++--- gdb/testsuite/gdb.guile/scm-objfile.exp | 5 ++--- gdb/testsuite/gdb.guile/scm-parameter.exp | 5 ++--- gdb/testsuite/gdb.guile/scm-ports.exp | 5 ++--- gdb/testsuite/gdb.guile/scm-pretty-print.exp | 5 ++--- gdb/testsuite/gdb.guile/scm-progspace.exp | 5 ++--- .../gdb.guile/scm-section-script.exp | 5 ++--- gdb/testsuite/gdb.guile/scm-symbol.exp | 5 ++--- gdb/testsuite/gdb.guile/scm-symtab.exp | 5 ++--- gdb/testsuite/gdb.guile/scm-type.exp | 2 +- gdb/testsuite/gdb.guile/scm-value-cc.exp | 5 +---- gdb/testsuite/gdb.guile/scm-value.exp | 5 ++--- gdb/testsuite/gdb.guile/types-module.exp | 5 ++--- gdb/testsuite/lib/gdb-guile.exp | 21 ++++--------------- 28 files changed, 56 insertions(+), 97 deletions(-) diff --git a/gdb/testsuite/gdb.guile/scm-arch.exp b/gdb/testsuite/gdb.guile/scm-arch.exp index 7ec1db108ef..c2554d853d9 100644 --- a/gdb/testsuite/gdb.guile/scm-arch.exp +++ b/gdb/testsuite/gdb.guile/scm-arch.exp @@ -15,15 +15,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-block.exp b/gdb/testsuite/gdb.guile/scm-block.exp index 666d6fd458d..20fbd1784b5 100644 --- a/gdb/testsuite/gdb.guile/scm-block.exp +++ b/gdb/testsuite/gdb.guile/scm-block.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-breakpoint.exp b/gdb/testsuite/gdb.guile/scm-breakpoint.exp index cd469ca4488..a9e656ddfc0 100644 --- a/gdb/testsuite/gdb.guile/scm-breakpoint.exp +++ b/gdb/testsuite/gdb.guile/scm-breakpoint.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - proc_with_prefix test_bkpt_basic { } { global srcfile testfile hex decimal diff --git a/gdb/testsuite/gdb.guile/scm-cmd.exp b/gdb/testsuite/gdb.guile/scm-cmd.exp index 1d4e13d7aef..a7fb59b0089 100644 --- a/gdb/testsuite/gdb.guile/scm-cmd.exp +++ b/gdb/testsuite/gdb.guile/scm-cmd.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-disasm.exp b/gdb/testsuite/gdb.guile/scm-disasm.exp index 6609c746756..37b710f9f99 100644 --- a/gdb/testsuite/gdb.guile/scm-disasm.exp +++ b/gdb/testsuite/gdb.guile/scm-disasm.exp @@ -15,15 +15,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-equal.exp b/gdb/testsuite/gdb.guile/scm-equal.exp index d2fb9ef0161..3f6e0c51986 100644 --- a/gdb/testsuite/gdb.guile/scm-equal.exp +++ b/gdb/testsuite/gdb.guile/scm-equal.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-error.exp b/gdb/testsuite/gdb.guile/scm-error.exp index b0de521cb5c..168d71d1b9e 100644 --- a/gdb/testsuite/gdb.guile/scm-error.exp +++ b/gdb/testsuite/gdb.guile/scm-error.exp @@ -19,13 +19,12 @@ set testfile "scm-error" load_lib gdb-guile.exp +require allow_guile_tests + # Start with a fresh gdb. gdb_exit gdb_start -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - # Test error while loading .scm. set remote_guile_file_1 [gdb_remote_download host \ diff --git a/gdb/testsuite/gdb.guile/scm-frame-args.exp b/gdb/testsuite/gdb.guile/scm-frame-args.exp index 075f4419c17..67c10f65b3e 100644 --- a/gdb/testsuite/gdb.guile/scm-frame-args.exp +++ b/gdb/testsuite/gdb.guile/scm-frame-args.exp @@ -15,15 +15,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-frame-inline.exp b/gdb/testsuite/gdb.guile/scm-frame-inline.exp index 88a69fd882b..1f73ed67b90 100644 --- a/gdb/testsuite/gdb.guile/scm-frame-inline.exp +++ b/gdb/testsuite/gdb.guile/scm-frame-inline.exp @@ -15,15 +15,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-frame.exp b/gdb/testsuite/gdb.guile/scm-frame.exp index 3118d6bcd2f..2e854967d36 100644 --- a/gdb/testsuite/gdb.guile/scm-frame.exp +++ b/gdb/testsuite/gdb.guile/scm-frame.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - # The following tests require execution. if ![gdb_guile_runto_main] { diff --git a/gdb/testsuite/gdb.guile/scm-gsmob.exp b/gdb/testsuite/gdb.guile/scm-gsmob.exp index ded2a85c9d2..a7c95c01c11 100644 --- a/gdb/testsuite/gdb.guile/scm-gsmob.exp +++ b/gdb/testsuite/gdb.guile/scm-gsmob.exp @@ -18,13 +18,12 @@ load_lib gdb-guile.exp +require allow_guile_tests + # Start with a fresh gdb. gdb_exit gdb_start -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - gdb_reinitialize_dir $srcdir/$subdir gdb_install_guile_utils diff --git a/gdb/testsuite/gdb.guile/scm-iterator.exp b/gdb/testsuite/gdb.guile/scm-iterator.exp index 15974523324..0bf459518a1 100644 --- a/gdb/testsuite/gdb.guile/scm-iterator.exp +++ b/gdb/testsuite/gdb.guile/scm-iterator.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-lazy-string.exp b/gdb/testsuite/gdb.guile/scm-lazy-string.exp index 9b2960a4093..605235648a3 100644 --- a/gdb/testsuite/gdb.guile/scm-lazy-string.exp +++ b/gdb/testsuite/gdb.guile/scm-lazy-string.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } { return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - #gdb_install_guile_utils #gdb_install_guile_module diff --git a/gdb/testsuite/gdb.guile/scm-math.exp b/gdb/testsuite/gdb.guile/scm-math.exp index 97a2e58766b..42e195a0778 100644 --- a/gdb/testsuite/gdb.guile/scm-math.exp +++ b/gdb/testsuite/gdb.guile/scm-math.exp @@ -18,6 +18,8 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile proc test_value_numeric_ops {} { @@ -335,9 +337,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c}]} { return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-objfile-script.exp b/gdb/testsuite/gdb.guile/scm-objfile-script.exp index bd0fd003cb6..5b480d1ea55 100644 --- a/gdb/testsuite/gdb.guile/scm-objfile-script.exp +++ b/gdb/testsuite/gdb.guile/scm-objfile-script.exp @@ -18,6 +18,8 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} { @@ -28,9 +30,6 @@ if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} { gdb_exit gdb_start -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - # Make the -gdb.scm script available to gdb, it is automagically loaded by gdb. # Care is taken to put it in the same directory as the binary so that # gdb will find it. diff --git a/gdb/testsuite/gdb.guile/scm-objfile.exp b/gdb/testsuite/gdb.guile/scm-objfile.exp index eb49600aa2c..f27c9f4027c 100644 --- a/gdb/testsuite/gdb.guile/scm-objfile.exp +++ b/gdb/testsuite/gdb.guile/scm-objfile.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-parameter.exp b/gdb/testsuite/gdb.guile/scm-parameter.exp index db76fc2d1c8..d62ae473faa 100644 --- a/gdb/testsuite/gdb.guile/scm-parameter.exp +++ b/gdb/testsuite/gdb.guile/scm-parameter.exp @@ -18,14 +18,13 @@ load_lib gdb-guile.exp +require allow_guile_tests + # Start with a fresh gdb. gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - gdb_install_guile_utils gdb_install_guile_module diff --git a/gdb/testsuite/gdb.guile/scm-ports.exp b/gdb/testsuite/gdb.guile/scm-ports.exp index 318c434241a..f0af5d4bbad 100644 --- a/gdb/testsuite/gdb.guile/scm-ports.exp +++ b/gdb/testsuite/gdb.guile/scm-ports.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-pretty-print.exp b/gdb/testsuite/gdb.guile/scm-pretty-print.exp index f21ed41bffd..3c20edf5061 100644 --- a/gdb/testsuite/gdb.guile/scm-pretty-print.exp +++ b/gdb/testsuite/gdb.guile/scm-pretty-print.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile # Start with a fresh gdb. gdb_exit gdb_start -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - proc run_lang_tests {exefile lang} { with_test_prefix "lang=$lang" { global srcdir subdir srcfile testfile hex diff --git a/gdb/testsuite/gdb.guile/scm-progspace.exp b/gdb/testsuite/gdb.guile/scm-progspace.exp index f43e65e9673..c12a81e8ed1 100644 --- a/gdb/testsuite/gdb.guile/scm-progspace.exp +++ b/gdb/testsuite/gdb.guile/scm-progspace.exp @@ -18,6 +18,8 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} { @@ -30,9 +32,6 @@ gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - gdb_install_guile_utils gdb_install_guile_module diff --git a/gdb/testsuite/gdb.guile/scm-section-script.exp b/gdb/testsuite/gdb.guile/scm-section-script.exp index 34ee6de3fdb..9e52939aae3 100644 --- a/gdb/testsuite/gdb.guile/scm-section-script.exp +++ b/gdb/testsuite/gdb.guile/scm-section-script.exp @@ -30,6 +30,8 @@ if {![istarget *-*-linux*] load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile # Make this available to gdb before the program starts, it is @@ -48,9 +50,6 @@ if {[build_executable $testfile.exp $testfile $srcfile \ gdb_exit gdb_start -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - gdb_reinitialize_dir $srcdir/$subdir # Try first with a restrictive safe-path. diff --git a/gdb/testsuite/gdb.guile/scm-symbol.exp b/gdb/testsuite/gdb.guile/scm-symbol.exp index f4b935f787f..fa2cf778284 100644 --- a/gdb/testsuite/gdb.guile/scm-symbol.exp +++ b/gdb/testsuite/gdb.guile/scm-symbol.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { return -1 } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - # These tests are done before we call gdb_guile_runto_main so we have to # import the gdb module ourselves. gdb_install_guile_utils diff --git a/gdb/testsuite/gdb.guile/scm-symtab.exp b/gdb/testsuite/gdb.guile/scm-symtab.exp index 33308e0f008..0f468b7d373 100644 --- a/gdb/testsuite/gdb.guile/scm-symtab.exp +++ b/gdb/testsuite/gdb.guile/scm-symtab.exp @@ -18,6 +18,8 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile scm-symtab.c scm-symtab-2.c if {[prepare_for_testing "failed to prepare" $testfile \ @@ -25,9 +27,6 @@ if {[prepare_for_testing "failed to prepare" $testfile \ return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-type.exp b/gdb/testsuite/gdb.guile/scm-type.exp index f8902a30a62..45139cba0d5 100644 --- a/gdb/testsuite/gdb.guile/scm-type.exp +++ b/gdb/testsuite/gdb.guile/scm-type.exp @@ -43,7 +43,7 @@ proc restart_gdb {exefile} { gdb_reinitialize_dir $srcdir/$subdir gdb_load ${exefile} - if { [skip_guile_tests] } { + if { ![allow_guile_tests] } { return 0 } diff --git a/gdb/testsuite/gdb.guile/scm-value-cc.exp b/gdb/testsuite/gdb.guile/scm-value-cc.exp index 5b2a3c96c80..921d7a939a3 100644 --- a/gdb/testsuite/gdb.guile/scm-value-cc.exp +++ b/gdb/testsuite/gdb.guile/scm-value-cc.exp @@ -18,7 +18,7 @@ load_lib gdb-guile.exp -require allow_cplus_tests +require allow_cplus_tests allow_guile_tests standard_testfile .cc @@ -26,9 +26,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-value.exp b/gdb/testsuite/gdb.guile/scm-value.exp index 9858b1c1a38..a00c9409086 100644 --- a/gdb/testsuite/gdb.guile/scm-value.exp +++ b/gdb/testsuite/gdb.guile/scm-value.exp @@ -18,6 +18,8 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile set has_argv0 [gdb_has_argv0] @@ -427,9 +429,6 @@ if { [build_inferior "${binfile}" "c"] < 0 } { # Start with a fresh gdb. clean_restart ${binfile} -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - gdb_install_guile_utils gdb_install_guile_module diff --git a/gdb/testsuite/gdb.guile/types-module.exp b/gdb/testsuite/gdb.guile/types-module.exp index 520c9021575..2b90d1b613a 100644 --- a/gdb/testsuite/gdb.guile/types-module.exp +++ b/gdb/testsuite/gdb.guile/types-module.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile .cc if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/lib/gdb-guile.exp b/gdb/testsuite/lib/gdb-guile.exp index 845d584b914..f2307372b8b 100644 --- a/gdb/testsuite/lib/gdb-guile.exp +++ b/gdb/testsuite/lib/gdb-guile.exp @@ -18,24 +18,11 @@ # Guile doesn't print the 0x prefix on hex numbers. set ghex {[0-9a-f]+} -# Return a 1 for configurations that do not support Guile scripting. +# Return a 1 for configurations that support Guile scripting. -proc skip_guile_tests {} { - global gdb_prompt - - gdb_test_multiple "guile (display \"test\\n\")" "verify guile support" { - -re "Undefined command.*$gdb_prompt $" { - unsupported "Guile not supported." - return 1 - } - -re "not supported.*$gdb_prompt $" { - unsupported "Guile support is disabled." - return 1 - } - -re "$gdb_prompt $" {} - } - - return 0 +gdb_caching_proc allow_guile_tests { + set output [exec $::GDB --configuration] + return [expr {[string first "--with-guile" $output] != -1}] } # Run a command in GDB, and report a failure if a Scheme exception is thrown.