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 A18A83857C4F for ; Wed, 14 Jul 2021 04:53:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A18A83857C4F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de 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 C2C2122939 for ; Wed, 14 Jul 2021 04:53:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1626238405; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=2HJkaIEIhqLcJImaRfzLcUrq1hUdRLP+EqjJkkliQdA=; b=bwwl4x/Oc6tYpQIkoQUbykFUD5q4i5UtjOnTqZkV9IFI2P1ueMYuDtZdk9n3UJll5NrDSL Ynkji65fbASt/ETlASA+n92jYO3PCRz9LfllLXz9xbuyOHMzYSNHsl16EukmkJSjIqMcIg Oas0nlxVZJJMt2VcMP0snibL4Q9I5Yo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1626238405; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=2HJkaIEIhqLcJImaRfzLcUrq1hUdRLP+EqjJkkliQdA=; b=L1KzfLyJ7MYi6BG687DDHje311gU4/ciR+ph+UmIV9DCsybcCmBGp8+j4jBanQCndaucey gXhJz2ZAr5FkVOBA== 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 AA41012FF7 for ; Wed, 14 Jul 2021 04:53:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ZGYPIcVt7mBZWAAAMHmgww (envelope-from ) for ; Wed, 14 Jul 2021 04:53:25 +0000 Date: Wed, 14 Jul 2021 06:53:23 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Add missing skip_tui_tests Message-ID: <20210714045322.GA22491@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-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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: Wed, 14 Jul 2021 04:53:28 -0000 Hi, When building gdb with --disable-tui, we run into: ... (gdb) frame apply all -- -^M Undefined command: "-". Try "help".^M (gdb) ERROR: Undefined command "frame apply all -- -". UNRESOLVED: gdb.base/options.exp: test-frame-apply: frame apply all -- - ... Fix this by detecting whether tui is supported, and skipping the tui-related tests otherwise. Same in some gdb.tui test-cases. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Add missing skip_tui_tests gdb/testsuite/ChangeLog: 2021-07-13 Tom de Vries * gdb.base/options.exp: Skip tui-related tests when tui is not supported. * gdb.python/tui-window-disabled.exp: Same. * gdb.python/tui-window.exp: Same. --- gdb/testsuite/gdb.base/options.exp | 33 +++++++++++++++--------- gdb/testsuite/gdb.python/tui-window-disabled.exp | 5 ++++ gdb/testsuite/gdb.python/tui-window.exp | 5 ++++ 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/gdb/testsuite/gdb.base/options.exp b/gdb/testsuite/gdb.base/options.exp index 78ec54502c0..6b48a0f4a4b 100644 --- a/gdb/testsuite/gdb.base/options.exp +++ b/gdb/testsuite/gdb.base/options.exp @@ -46,6 +46,8 @@ if { ![readline_is_used] } { return -1 } +set tui_supported_p [expr ![skip_tui_tests]] + # Check the completion result, as returned by the "maintenance show # test-options-completion-result" command. TEST is used as test name. proc check_completion_result {expected test} { @@ -320,6 +322,8 @@ proc_with_prefix test-backtrace {} { # Basic option-machinery + "frame apply" command integration tests. proc_with_prefix test-frame-apply {} { + global tui_supported_p + test_gdb_complete_unique "frame apply all" "frame apply all" gdb_test "frame apply level 0-" \ @@ -376,12 +380,14 @@ proc_with_prefix test-frame-apply {} { test_gdb_completion_offers_commands "$cmd -- " } - # '-' is a valid TUI command. - test_error_cmd2 $cmd " -- -" \ - "Cannot enable the TUI when output is not a terminal" - test_gdb_complete_unique \ - "$cmd -- -" \ - "$cmd -- -" + if { $tui_supported_p } { + # '-' is a valid TUI command. + test_error_cmd2 $cmd " -- -" \ + "Cannot enable the TUI when output is not a terminal" + test_gdb_complete_unique \ + "$cmd -- -" \ + "$cmd -- -" + } test_error_cmd2 $cmd " -foo" \ "Undefined command: \"-foo\". Try \"help\"\\." @@ -393,6 +399,7 @@ proc_with_prefix test-frame-apply {} { # Basic option-machinery + "thread apply" command integration tests. proc_with_prefix test-thread-apply {} { + global tui_supported_p test_gdb_complete_unique "thread apply all" "thread apply all" test_gdb_complete_unique "taas" "taas" @@ -457,12 +464,14 @@ proc_with_prefix test-thread-apply {} { test_gdb_completion_offers_commands "$cmd -- " } - # '-' is a valid TUI command. - test_invalid_cmd "$cmd" " -- -" \ - "Cannot enable the TUI when output is not a terminal" - test_gdb_complete_unique \ - "$cmd -- -" \ - "$cmd -- -" + if { $tui_supported_p } { + # '-' is a valid TUI command. + test_invalid_cmd "$cmd" " -- -" \ + "Cannot enable the TUI when output is not a terminal" + test_gdb_complete_unique \ + "$cmd -- -" \ + "$cmd -- -" + } test_invalid_cmd $cmd " -foo" \ "Undefined command: \"-foo\". Try \"help\"\\." diff --git a/gdb/testsuite/gdb.python/tui-window-disabled.exp b/gdb/testsuite/gdb.python/tui-window-disabled.exp index af1fa0cde63..f43530bb64a 100644 --- a/gdb/testsuite/gdb.python/tui-window-disabled.exp +++ b/gdb/testsuite/gdb.python/tui-window-disabled.exp @@ -30,6 +30,11 @@ if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} { return -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 \ ${srcdir}/${subdir}/${testfile}.py] diff --git a/gdb/testsuite/gdb.python/tui-window.exp b/gdb/testsuite/gdb.python/tui-window.exp index 8d86afb1449..4710dd67f43 100644 --- a/gdb/testsuite/gdb.python/tui-window.exp +++ b/gdb/testsuite/gdb.python/tui-window.exp @@ -25,6 +25,11 @@ if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} { return -1 } +clean_restart +if {[skip_tui_tests]} { + return +} + Term::clean_restart 24 80 $testfile # Skip all tests if Python scripting is not enabled.