From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rock.gnat.com (rock.gnat.com [IPv6:2620:20:4000:0:a9e:1ff:fe9b:1d1]) by sourceware.org (Postfix) with ESMTP id C39BC3851C04 for ; Tue, 19 May 2020 18:35:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C39BC3851C04 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey@adacore.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id A55B25618C; Tue, 19 May 2020 14:35:34 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at gnat.com Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id cQMEL8-2B6uQ; Tue, 19 May 2020 14:35:34 -0400 (EDT) Received: from murgatroyd.Home (174-16-104-48.hlrn.qwest.net [174.16.104.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 6AEB85618B; Tue, 19 May 2020 14:35:34 -0400 (EDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [pushed] Fix duplicate tests in gdb.rust Date: Tue, 19 May 2020 12:35:32 -0600 Message-Id: <20200519183532.11170-1-tromey@adacore.com> X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-16.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, 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, 19 May 2020 18:35:35 -0000 gdb.rust complains about some duplicate test names. This patch fixes this in a straightforward way. 2020-05-19 Tom Tromey * gdb.rust/simple.exp: Add some test descriptions. (test_one_slice): Use with_test_prefix. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.rust/simple.exp | 18 ++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/gdb/testsuite/gdb.rust/simple.exp b/gdb/testsuite/gdb.rust/simple.exp index 6daaf8415c5..2653170df31 100644 --- a/gdb/testsuite/gdb.rust/simple.exp +++ b/gdb/testsuite/gdb.rust/simple.exp @@ -45,11 +45,11 @@ gdb_test "ptype c" " = i32" gdb_test "print sizeof(c)" " = 4" gdb_test "print c = 87" " = \\(\\)" -gdb_test "print c" " = 87" +gdb_test "print c" " = 87" "print after assignment" gdb_test "print c += 3" " = \\(\\)" -gdb_test "print c" " = 90" +gdb_test "print c" " = 90" "print after plus assignment" gdb_test "print c -= 90" " = \\(\\)" -gdb_test "print c" " = 0" +gdb_test "print c" " = 0" "print after minus assignment" gdb_test "print *&c" " = 0" gdb_test "print *(&c as &i32)" " = 0" gdb_test "print *(&c as *const i32)" " = 0" @@ -88,7 +88,7 @@ gdb_test "print w\[2\] @ 2" " = \\\[3, 4\\\]" gdb_test "print w_ptr\[2\]" " = 3" gdb_test "print fromslice" " = 3" gdb_test "print slice\[0\]" " = 3" -gdb_test "print slice as &\[i32\]\[0\]" " = 3" +gdb_test "print slice as &\[i32\]\[0\]" gdb_test_sequence "ptype slice" "" { " = struct &\\\[i32\\\] \\{" @@ -289,12 +289,14 @@ gdb_test "print st" \ " = simple::StringAtOffset {field1: \"hello\", field2: 1, field3: \"world\"}" proc test_one_slice {svar length base range} { - global hex + with_test_prefix $range { + global hex - set result " = &\\\[.*\\\] \\{data_ptr: $hex, length: $length\\}" + set result " = &\\\[.*\\\] \\{data_ptr: $hex, length: $length\\}" - gdb_test "print $svar" $result - gdb_test "print &${base}\[${range}\]" $result + gdb_test "print $svar" $result + gdb_test "print &${base}\[${range}\]" $result + } } test_one_slice slice 1 w 2..3 -- 2.21.1