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 724773856DCB for ; Fri, 21 Apr 2023 14:58:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 724773856DCB 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 ACFE91FE11 for ; Fri, 21 Apr 2023 14:58:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1682089120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xiQw0BuY6WDy8odxzLFhXjU/Z9mw604MDK37mlRWO6w=; b=lYh5iX/L0RjFrlK3+T9qzFpV5NaUqn0adgp1rNbzhOP79ed2+U1ylBeKFdg43g2KGAqrQ/ C+iM4PmjfGnMBTlx8OoKhnze5Xl8PoHzNZJVzh98gRMYnmMAFlYmuT7I4HiAUKwwxpNs0t xT1fU/EEOTGZ8xV+6CJpTc6W1OFlbvI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1682089120; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xiQw0BuY6WDy8odxzLFhXjU/Z9mw604MDK37mlRWO6w=; b=mbJUppijcr7J0BJgbJGN+mUxh6o9a01h4Jm2JwMViAelLgu/H/XhjLscfYclrjdp98tsRk CqgCp8Fpdo5Qr5Bg== 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 9B2441391A for ; Fri, 21 Apr 2023 14:58:40 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id cGm7JKCkQmTqDAAAMHmgww (envelope-from ) for ; Fri, 21 Apr 2023 14:58:40 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH 1/3] [gdb/testsuite] Fix -wrap in presence of -prompt in gdb_test_multiple Date: Fri, 21 Apr 2023 16:58:31 +0200 Message-Id: <20230421145833.24521-2-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230421145833.24521-1-tdevries@suse.de> References: <20230421145833.24521-1-tdevries@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.5 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,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: While writing a gdb_test_multiple call in a test-case I tried to use -wrap in combination with -prompt and found out that it doesn't work, because -wrap uses "$gdb_prompt $" instead of $prompt_regexp. Fix this by making -wrap use $prompt_regexp. Tested on x86_64-linux. --- gdb/testsuite/gdb.testsuite/gdb-test.exp | 11 +++++++++++ gdb/testsuite/lib/gdb.exp | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.testsuite/gdb-test.exp b/gdb/testsuite/gdb.testsuite/gdb-test.exp index a582b1b125f..e19f2a8de4a 100644 --- a/gdb/testsuite/gdb.testsuite/gdb-test.exp +++ b/gdb/testsuite/gdb.testsuite/gdb-test.exp @@ -48,3 +48,14 @@ with_test_prefix "cmd with trailing control code" { gdb_assert { [string equal $output $expected_error_msg] } } } + +# Change the prompt. +set prompt "(GDB) " +set prompt_re "\\(GDB\\) $" +gdb_test -prompt $prompt_re "set prompt $prompt" + +gdb_test_multiple "print 1" "" -prompt $prompt_re { + -re -wrap " = 1" { + pass $gdb_test_name + } +} diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 9ea0334759d..fec64ed1e6c 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -1126,7 +1126,7 @@ proc gdb_test_multiple { command message args } { if { $wrap_pattern } { # Wrap subst_item as is done for the gdb_test PATTERN argument. lappend $current_list \ - "\[\r\n\]*(?:$subst_item)\[\r\n\]+$gdb_prompt $" + "\[\r\n\]*(?:$subst_item)\[\r\n\]+$prompt_regexp" set wrap_pattern 0 } else { lappend $current_list $subst_item -- 2.35.3