From patchwork Wed Sep 14 22:59:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 15647 Received: (qmail 79830 invoked by alias); 14 Sep 2016 22:59:51 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 79820 invoked by uid 89); 14 Sep 2016 22:59:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:U*tom, H*m:tom X-HELO: gproxy8-pub.mail.unifiedlayer.com Received: from gproxy8-pub.mail.unifiedlayer.com (HELO gproxy8-pub.mail.unifiedlayer.com) (67.222.33.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Wed, 14 Sep 2016 22:59:40 +0000 Received: (qmail 18102 invoked by uid 0); 14 Sep 2016 22:59:38 -0000 Received: from unknown (HELO cmgw2) (10.0.90.83) by gproxy8.mail.unifiedlayer.com with SMTP; 14 Sep 2016 22:59:38 -0000 Received: from box522.bluehost.com ([74.220.219.122]) by cmgw2 with id jazZ1t00L2f2jeq01azces; Wed, 14 Sep 2016 16:59:36 -0600 X-Authority-Analysis: v=2.1 cv=OqjclUPt c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=PnD2wP_eR3oA:10 a=Cq4ZOyQJfnsA:10 a=GW1xBdLrtEIA:10 a=zstS-IiYAAAA:8 a=q6fv6FekNt1pmSLFf_sA:9 a=4G6NA9xxw8l3yy4pmD5M:22 Received: from 174-16-151-161.hlrn.qwest.net ([174.16.151.161]:54940 helo=localhost.localdomain) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_2) (envelope-from ) id 1bkJ9S-0003PC-RP; Wed, 14 Sep 2016 16:59:34 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 2/2] Make some test names invariant Date: Wed, 14 Sep 2016 16:59:22 -0600 Message-Id: <1473893962-12420-2-git-send-email-tom@tromey.com> In-Reply-To: <1473893962-12420-1-git-send-email-tom@tromey.com> References: <1473893962-12420-1-git-send-email-tom@tromey.com> X-Identified-User: {36111:box522.bluehost.com:elynrobi:tromey.com} {sentby:smtp auth 174.16.151.161 authed with tom+tromey.com} X-Exim-ID: 1bkJ9S-0003PC-RP X-Source-Sender: 174-16-151-161.hlrn.qwest.net (localhost.localdomain) [174.16.151.161]:54940 X-Source-Auth: tom+tromey.com X-Email-Count: 0 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== While working on the previous patch, I noticed that the test names in process-dies-while-detaching include the PID of some test process, making it so that the test names change between runs. This patch fixes the problem. 2016-09-14 Tom Tromey * gdb.threads/process-dies-while-detaching.exp (test_detach_killed_outside): Pass test name to get_integer_valueof. * lib/gdb.exp (get_integer_valueof): Add "test" argument. --- gdb/testsuite/ChangeLog | 7 +++++++ gdb/testsuite/gdb.threads/process-dies-while-detaching.exp | 2 +- gdb/testsuite/lib/gdb.exp | 6 ++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index e34ae67..b397364 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2016-09-14 Tom Tromey + + * gdb.threads/process-dies-while-detaching.exp + (test_detach_killed_outside): Pass test name to + get_integer_valueof. + * lib/gdb.exp (get_integer_valueof): Add "test" argument. + 2016-09-13 Tom Tromey PR gdb/20604: diff --git a/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp b/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp index 52dc8dd..734effc 100644 --- a/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp +++ b/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp @@ -268,7 +268,7 @@ proc test_detach_killed_outside {multi_process cmd} { # Run to _exit in the child. continue_to_exit_bp - set childpid [get_integer_valueof "mypid" -1] + set childpid [get_integer_valueof "mypid" -1 "get value of mypid"] if { $childpid == -1 } { untested "failed to extract child pid" return -1 diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index e538812..9abe3cd 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -5524,10 +5524,12 @@ proc get_valueof { fmt exp default } { return ${val} } -proc get_integer_valueof { exp default } { +proc get_integer_valueof { exp default {test ""} } { global gdb_prompt - set test "get integer valueof \"${exp}\"" + if {$test == ""} { + set test "get integer valueof \"${exp}\"" + } set val ${default} gdb_test_multiple "print /d ${exp}" "$test" { -re "\\$\[0-9\]* = (\[-\]*\[0-9\]*).*$gdb_prompt $" {