From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id A4AEE3858416 for ; Tue, 6 Jun 2023 15:03:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A4AEE3858416 Authentication-Results: sourceware.org; dmarc=pass (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-out2.suse.de (Postfix) with ESMTPS id C68831FD79; Tue, 6 Jun 2023 15:03:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686063810; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=E0iyZEDPDXoLb5MXSeR9M4t7avlPWZMi/Ie82bTWcWs=; b=Mhpey+UVlTElnTbEIpPqw5JJkybvb0wvRMP0CdffXfoX1kINl0PYo4S92X1/FFMGOYQyuv IJJMhQpXO0TlH3/vpjulwY7Ln9zWEs9Wti+k3mV5w/yrr/2CqspfWhRuDoRPkZd8I4h9pL l1n7bCX5Sm6M09VbYb3cZeAt6ylrE6k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686063810; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=E0iyZEDPDXoLb5MXSeR9M4t7avlPWZMi/Ie82bTWcWs=; b=9kwBs5DUITlZMHS/NRiAALljKDmhucSf4zCWv9t0tKV0/KC/piUbOo591Vsg454yRnJHVn e//ZUhdI2pzqB5AQ== 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 AEBFD13776; Tue, 6 Jun 2023 15:03:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id rf97KcJKf2TDEQAAMHmgww (envelope-from ); Tue, 06 Jun 2023 15:03:30 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 1/2] [gdb/testsuite] Add test-case gdb.tui/single-key.exp Date: Tue, 6 Jun 2023 17:03:32 +0200 Message-Id: <20230606150333.5206-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: I noticed that there's no test-case excercising SingleKey mode, so add a test-case. Tested on x86_64-linux. --- gdb/testsuite/gdb.tui/single-key.exp | 60 ++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 gdb/testsuite/gdb.tui/single-key.exp diff --git a/gdb/testsuite/gdb.tui/single-key.exp b/gdb/testsuite/gdb.tui/single-key.exp new file mode 100644 index 00000000000..07c9b00cce5 --- /dev/null +++ b/gdb/testsuite/gdb.tui/single-key.exp @@ -0,0 +1,60 @@ +# Copyright 2023 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +tuiterm_env + +Term::clean_restart 24 80 +if {![Term::enter_tui]} { + unsupported "TUI not supported" + return +} + +set status_win { 0 15 80 1 } +set command_win { 0 16 80 8 } + +# Check that the status window doesn't show Singlekey. +set re "No process In:" +Term::check_region_contents "status window: initial" {*}$status_win $re + +# Enter single-key mode. Check that the status window does show Singlekey. +send_gdb "\030s" +set re "No process \\(SingleKey\\) In:" +gdb_assert { [Term::wait_for_region_contents {*}$status_win $re] } \ + "status window: single-key mode" + +# Send "down command". +send_gdb "d" +gdb_assert { [Term::wait_for_region_contents {*}$command_win "No stack\\."] } \ + "down using single-key d" + +# Quit single-key mode. +send_gdb "q" +gdb_assert { [Term::wait_for ""] } "quit using single-key q" + +# Enter single-key mode, again. +send_gdb "\030s" + +# Send string that doesn't start with a single-key. +send_gdb "abc" +set re "$gdb_prompt abc" +gdb_assert { [Term::wait_for_region_contents {*}$command_win $re] } \ + "temporary command prompt" + +# Enter undefined command abc, and back to single-key mode. +send_gdb "\n" + +# Exit single-key mode, now using C-x s. +send_gdb "\030s" +gdb_assert { [Term::wait_for ""] } "quit using C-x s" base-commit: d3f340763bab7c74838ebb481fd7ff93acd9f00c -- 2.35.3