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 6D6F3394742E for ; Tue, 8 Jun 2021 08:05:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6D6F3394742E 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 imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 7E2651FD2A for ; Tue, 8 Jun 2021 08:05:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623139550; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=PjbTOJIxq73SRaw7LKgyrGLxRzwqhUM30n3J5bu9Qss=; b=HSI3qtZ7sjtO+9mXWDTh28ZP/DMJ7kFJUkWbMvp4D7LuFACOyZ+fKvjbnwCJS8RxBfz9Sq zEnKPVi1jkI+qKpwW6HtnHyVPurOuYu5tLGSem7EBErprHof69deghJRDtnFLlC3BdkxpD XX8pNqAog6EAb7jTfLU5GyIH+37e6CA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623139550; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=PjbTOJIxq73SRaw7LKgyrGLxRzwqhUM30n3J5bu9Qss=; b=eaU8aQe5A6Lteh8ZClnk6qnV6XgygQZZ1L3GkHP+8MAOS+1c5+awwaw9wqe8sxYVjGIvSK L7DrhMxhJgF/e9DA== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id 639FD118DD for ; Tue, 8 Jun 2021 08:05:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623139550; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=PjbTOJIxq73SRaw7LKgyrGLxRzwqhUM30n3J5bu9Qss=; b=HSI3qtZ7sjtO+9mXWDTh28ZP/DMJ7kFJUkWbMvp4D7LuFACOyZ+fKvjbnwCJS8RxBfz9Sq zEnKPVi1jkI+qKpwW6HtnHyVPurOuYu5tLGSem7EBErprHof69deghJRDtnFLlC3BdkxpD XX8pNqAog6EAb7jTfLU5GyIH+37e6CA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623139550; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=PjbTOJIxq73SRaw7LKgyrGLxRzwqhUM30n3J5bu9Qss=; b=eaU8aQe5A6Lteh8ZClnk6qnV6XgygQZZ1L3GkHP+8MAOS+1c5+awwaw9wqe8sxYVjGIvSK L7DrhMxhJgF/e9DA== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id O29hF94kv2AGLwAALh3uQQ (envelope-from ) for ; Tue, 08 Jun 2021 08:05:50 +0000 Date: Tue, 8 Jun 2021 10:05:49 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Simplify gdb.base/sect-cmd.exp Message-ID: <20210608080547.GA14627@delia> 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.6 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Tue, 08 Jun 2021 08:05:53 -0000 Hi, While looking at gdb.base/sect-cmd.exp, I noticed a few things that can be simplified: - use gdb_test instead of gdb_test_multiple - use -wrap "" as regexp Also, I noticed this: ... fail "$gdb_test_name, saw not found marker" ... while our usual test naming scheme uses parentheses, like so: ... fail "$gdb_test_name (saw not found marker)" ... Fix the test-name and do the simplifications. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Simplify gdb.base/sect-cmd.exp gdb/testsuite/ChangeLog: 2021-06-08 Tom de Vries * gdb.base/sect-cmd.exp: Use gdb_test. Use -wrap "". Fix test name. --- gdb/testsuite/gdb.base/sect-cmd.exp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/gdb/testsuite/gdb.base/sect-cmd.exp b/gdb/testsuite/gdb.base/sect-cmd.exp index cb1e4464a69..387198d3732 100644 --- a/gdb/testsuite/gdb.base/sect-cmd.exp +++ b/gdb/testsuite/gdb.base/sect-cmd.exp @@ -63,21 +63,17 @@ gdb_test_multiple "section $section_name $address1" \ exp_continue } -re "Section \[^\r\n\]+ not found\r\n" { - fail "$gdb_test_name, saw not found marker" + fail "$gdb_test_name (saw not found marker)" exp_continue } - -re "$gdb_prompt $" { + -re -wrap "" { gdb_assert { $saw_section_address_line } $gdb_test_name } } # Verify that GDB responds gracefully to a non-existent section name. # -gdb_test_multiple "section FOOBARBAZ 0x1234" "" { - -re -wrap "Section FOOBARBAZ not found" { - pass $gdb_test_name - } -} +gdb_test "section FOOBARBAZ 0x1234" "Section FOOBARBAZ not found" # Check that GDB can still print the error message when the section # name is very long. It used to be the case that GDB could only print @@ -86,9 +82,6 @@ gdb_test_multiple "section FOOBARBAZ 0x1234" "" { # set long_sect_name \ "A234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123" -gdb_test_multiple "section $long_sect_name 0x1234" \ - "non-existent too-long section disallowed" { - -re -wrap "Section $long_sect_name not found" { - pass $gdb_test_name - } - } +gdb_test "section $long_sect_name 0x1234" \ + "Section $long_sect_name not found" \ + "non-existent too-long section disallowed"