From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gproxy1-pub.mail.unifiedlayer.com (gproxy1-pub.mail.unifiedlayer.com [69.89.25.95]) by sourceware.org (Postfix) with ESMTPS id 87D54382EF2F for ; Thu, 12 Jan 2023 03:01:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 87D54382EF2F 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 progateway3.mail.pro1.eigbox.com (Postfix) with ESMTP id 0C2EF10048C3B for ; Thu, 12 Jan 2023 03:01:52 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id FnqiplM5oLXXpFnqip4keM; Thu, 12 Jan 2023 03:01:52 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=KvyIZUaN c=1 sm=1 tr=0 ts=63bf7820 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=mDV3o1hIAAAA:8 a=by3yp007lqxJ0iIJBLcA:9 a=_FVE-zBwftR9WsbkzFJk:22 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=pJPv5WhyTphDFTdTxnpZc7DtIbw6UJly6IlYVF900M4=; b=x3W30VQ6DZm9/xBKHj81BUvEaB Wgp+NKy+myq6otYkl+eBUp2JOw93agoayqUEoicY2ApOGGtbg4KOxAHso8Au+F/aCwA2Wl0MzqZIi n8mxOB+pc+tFeSDMFUuW3dlCv; 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-Q8; Wed, 11 Jan 2023 20:01:51 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v2 78/79] Rename to allow_tui_tests Date: Wed, 11 Jan 2023 20:00:51 -0700 Message-Id: <20230112030052.3306113-79-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 Content-Transfer-Encoding: 8bit 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-Q8 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: 79 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,KAM_SHORT,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 List-Id: This changes skip_tui_tests to invert the sense, and renames it to allow_tui_tests. It also rewrites this function to use the output of "gdb --configuration", and it adds a note about the state of the TUI to that output. --- gdb/testsuite/gdb.base/options.exp | 2 +- .../gdb.python/tui-window-disabled.exp | 4 +--- gdb/testsuite/gdb.python/tui-window-names.exp | 6 +----- gdb/testsuite/gdb.python/tui-window.exp | 5 +---- gdb/testsuite/gdb.tui/completion.exp | 4 +++- gdb/testsuite/gdb.tui/tui-disasm-long-lines.exp | 2 +- gdb/testsuite/gdb.tui/tui-layout.exp | 6 ++---- .../gdb.tui/tui-nl-filtered-output.exp | 6 ++---- gdb/testsuite/lib/completion-support.exp | 2 +- gdb/testsuite/lib/gdb.exp | 17 ++++------------- gdb/testsuite/lib/tuiterm.exp | 2 +- gdb/top.c | 10 ++++++++++ 12 files changed, 28 insertions(+), 38 deletions(-) diff --git a/gdb/testsuite/gdb.base/options.exp b/gdb/testsuite/gdb.base/options.exp index 2be7f878e7e..486192e3472 100644 --- a/gdb/testsuite/gdb.base/options.exp +++ b/gdb/testsuite/gdb.base/options.exp @@ -47,7 +47,7 @@ if { ![readline_is_used] } { return -1 } -set tui_supported_p [expr ![skip_tui_tests]] +set tui_supported_p [allow_tui_tests] # Check the completion result, as returned by the "maintenance show # test-options-completion-result" command. TEST is used as test name. diff --git a/gdb/testsuite/gdb.python/tui-window-disabled.exp b/gdb/testsuite/gdb.python/tui-window-disabled.exp index 36ecb0b5ef1..57d41cdbf8b 100644 --- a/gdb/testsuite/gdb.python/tui-window-disabled.exp +++ b/gdb/testsuite/gdb.python/tui-window-disabled.exp @@ -22,6 +22,7 @@ # though the tui should be disabled. load_lib gdb-python.exp +require allow_tui_tests tuiterm_env standard_testfile @@ -31,9 +32,6 @@ if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} { } clean_restart -if {[skip_tui_tests]} { - return -} # Copy the Python script to where the tests are being run. set remote_python_file [gdb_remote_download host \ diff --git a/gdb/testsuite/gdb.python/tui-window-names.exp b/gdb/testsuite/gdb.python/tui-window-names.exp index 125a5f5a9b5..1a25be89299 100644 --- a/gdb/testsuite/gdb.python/tui-window-names.exp +++ b/gdb/testsuite/gdb.python/tui-window-names.exp @@ -18,16 +18,12 @@ load_lib gdb-python.exp -require allow_python_tests +require allow_python_tests allow_tui_tests tuiterm_env clean_restart -if {[skip_tui_tests]} { - return -} - # Define a function we can use as a window constructor. If this ever # gets called we'll throw an error, but that's OK, this test doesn't # actually try to create any windows. diff --git a/gdb/testsuite/gdb.python/tui-window.exp b/gdb/testsuite/gdb.python/tui-window.exp index 529ed16b641..af2a866e78b 100644 --- a/gdb/testsuite/gdb.python/tui-window.exp +++ b/gdb/testsuite/gdb.python/tui-window.exp @@ -16,7 +16,7 @@ # Test a TUI window implemented in Python. load_lib gdb-python.exp -require allow_python_tests +require allow_python_tests allow_tui_tests tuiterm_env # This test doesn't care about the inferior. @@ -27,9 +27,6 @@ if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} { } clean_restart -if {[skip_tui_tests]} { - return -} Term::clean_restart 24 80 $testfile diff --git a/gdb/testsuite/gdb.tui/completion.exp b/gdb/testsuite/gdb.tui/completion.exp index 00956488c9f..a3b3114a472 100644 --- a/gdb/testsuite/gdb.tui/completion.exp +++ b/gdb/testsuite/gdb.tui/completion.exp @@ -13,10 +13,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +require allow_tui_tests + gdb_exit gdb_start -if {[skip_tui_tests] || [target_info exists gdb,nointerrupts]} { +if {[target_info exists gdb,nointerrupts]} { return } diff --git a/gdb/testsuite/gdb.tui/tui-disasm-long-lines.exp b/gdb/testsuite/gdb.tui/tui-disasm-long-lines.exp index 0ad91308ca4..7e3cff3950b 100644 --- a/gdb/testsuite/gdb.tui/tui-disasm-long-lines.exp +++ b/gdb/testsuite/gdb.tui/tui-disasm-long-lines.exp @@ -33,7 +33,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "$binfile" \ clean_restart "$binfile" -if {[skip_tui_tests]} { +if {![allow_tui_tests]} { # TUI support is disabled. Check for error message. gdb_test "layout asm" "Undefined command: \"layout\". Try \"help\"." return diff --git a/gdb/testsuite/gdb.tui/tui-layout.exp b/gdb/testsuite/gdb.tui/tui-layout.exp index 97734cf7b68..2c502191d11 100644 --- a/gdb/testsuite/gdb.tui/tui-layout.exp +++ b/gdb/testsuite/gdb.tui/tui-layout.exp @@ -16,16 +16,14 @@ # Minimal testcase that just checks that the various "layout $foo" # commands do not cause gdb to crash. +require allow_tui_tests + standard_testfile if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} { return -1 } -if {[skip_tui_tests]} { - return -} - # Test one layout command. EXECUTION indicates whether to activate # the layout with or without execution. diff --git a/gdb/testsuite/gdb.tui/tui-nl-filtered-output.exp b/gdb/testsuite/gdb.tui/tui-nl-filtered-output.exp index 5a2a4205bb5..b7ea67cf723 100644 --- a/gdb/testsuite/gdb.tui/tui-nl-filtered-output.exp +++ b/gdb/testsuite/gdb.tui/tui-nl-filtered-output.exp @@ -30,13 +30,11 @@ # # (gdb) +require allow_tui_tests + gdb_exit gdb_start -if {[skip_tui_tests]} { - return -} - # Enable the TUI. set test "tui enable" diff --git a/gdb/testsuite/lib/completion-support.exp b/gdb/testsuite/lib/completion-support.exp index f47f1d3ec50..bf9c5ad352c 100644 --- a/gdb/testsuite/lib/completion-support.exp +++ b/gdb/testsuite/lib/completion-support.exp @@ -555,7 +555,7 @@ proc test_gdb_completion_offers_commands {input_line} { # TUI adds additional commands to the possible completions, so we # need different patterns depending on whether or not it is enabled. - if { [skip_tui_tests] } { + if { ![allow_tui_tests] } { test_gdb_complete_multiple $input_line "" "" { "!" "actions" diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 31f11b22f87..5359315667e 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -2572,20 +2572,11 @@ gdb_caching_proc allow_dlmopen_tests { return $allow_dlmopen_tests } -# Return 1 if we should skip tui related tests. +# Return 1 if we should allow TUI-related tests. -proc skip_tui_tests {} { - global gdb_prompt - - gdb_test_multiple "help layout" "verify tui support" { - -re "Undefined command: \"layout\".*$gdb_prompt $" { - return 1 - } - -re "$gdb_prompt $" { - } - } - - return 0 +gdb_caching_proc allow_tui_tests { + set output [remote_exec host $::GDB --configuration] + return [expr {[string first "--enable-tui" $output] != -1}] } # Test files shall make sure all the test result lines in gdb.sum are diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp index 591c4ca9c4c..c38ccbbdbd7 100644 --- a/gdb/testsuite/lib/tuiterm.exp +++ b/gdb/testsuite/lib/tuiterm.exp @@ -778,7 +778,7 @@ namespace eval Term { # Setup ready for starting the tui, but don't actually start it. # Returns 1 on success, 0 if TUI tests should be skipped. proc prepare_for_tui {} { - if {[skip_tui_tests]} { + if {![allow_tui_tests]} { return 0 } diff --git a/gdb/top.c b/gdb/top.c index c32ab896a0e..205eb360ba3 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -1649,6 +1649,16 @@ This GDB was configured as follows:\n\ ")); #endif +#ifdef TUI + gdb_printf (stream, _("\ + --enable-tui\n\ +")); +#else + gdb_printf (stream, _("\ + --disable-tui\n\ +")); +#endif + #ifdef RELOC_SRCDIR gdb_printf (stream, _("\ --with-relocated-sources=%s\n\ -- 2.39.0