From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69905 invoked by alias); 13 Mar 2017 21:54:52 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 69895 invoked by uid 89); 13 Mar 2017 21:54:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-27.2 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 13 Mar 2017 21:54:50 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2152881F01; Mon, 13 Mar 2017 21:54:51 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2DLsnvH027830; Mon, 13 Mar 2017 17:54:50 -0400 Subject: Re: [PATCH 1/2] testsuite: Introduce dejagnu_version To: Simon Marchi , gdb-patches@sourceware.org References: <20170313212749.9607-1-simon.marchi@ericsson.com> From: Pedro Alves Message-ID: Date: Mon, 13 Mar 2017 21:54:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20170313212749.9607-1-simon.marchi@ericsson.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-03/txt/msg00207.txt.bz2 OK. Thanks, Pedro Alves On 03/13/2017 09:27 PM, Simon Marchi wrote: > The next patch will require checking the DejaGnu version. There is > already a test that does this, > gdb.threads/attach-many-short-lived-threads.exp. This patch introduces > a new procedure, dejagnu_version, and makes that test use it. > > The version number is "right-padded" with zeroes, to make sure that we > always return a triplet (major, minor, patch). > > The procedure does not consider the DejaGnu versions from git. For > example, if you used DejaGnu from its current master branch, the version > would be "1.6.1-git", meaning that 1.6.1 will be the next release. I > figured we'll cross that bridge when (and if) we get there. > > gdb/testsuite/ChangeLog: > > * lib/gdb.exp (dejagnu_version): New proc. > * gdb.threads/attach-many-short-lived-threads.exp (bad_dejagnu): > Use dejagnu_version. > --- > .../attach-many-short-lived-threads.exp | 8 +------ > gdb/testsuite/lib/gdb.exp | 26 ++++++++++++++++++++++ > 2 files changed, 27 insertions(+), 7 deletions(-) > > diff --git a/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp b/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp > index cd752ca496..edc96132e3 100644 > --- a/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp > +++ b/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp > @@ -24,13 +24,7 @@ > # Return true if the running version of DejaGnu is known to not be > # able to run this test. > proc bad_dejagnu {} { > - global frame_version > - > - verbose -log "DejaGnu version: $frame_version" > - verbose -log "Expect version: [exp_version]" > - verbose -log "Tcl version: [info tclversion]" > - > - set dj_ver [split $frame_version .] > + set dj_ver [dejagnu_version] > set dj_ver_major [lindex $dj_ver 0] > set dj_ver_minor [lindex $dj_ver 1] > > diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp > index 188484f792..c773d41bae 100644 > --- a/gdb/testsuite/lib/gdb.exp > +++ b/gdb/testsuite/lib/gdb.exp > @@ -6023,6 +6023,32 @@ proc multi_line_input { args } { > return [join $args "\n"] > } > > +# Return the version of the DejaGnu framework. > +# > +# The return value is a list containing the major, minor and patch version > +# numbers. If the version does not contain a minor or patch number, they will > +# be set to 0. For example: > +# > +# 1.6 -> {1 6 0} > +# 1.6.1 -> {1 6 1} > +# 2 -> {2 0 0} > + > +proc dejagnu_version { } { > + # The frame_version variable is defined by DejaGnu, in runtest.exp. > + global frame_version > + > + verbose -log "DejaGnu version: $frame_version" > + verbose -log "Expect version: [exp_version]" > + verbose -log "Tcl version: [info tclversion]" > + > + set dg_ver [split $frame_version .] > + > + while { [llength $dg_ver] < 3 } { > + lappend dg_ver 0 > + } > + > + return $dg_ver > +} > > # Always load compatibility stuff. > load_lib future.exp >