From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7860 invoked by alias); 16 May 2013 09:19:20 -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 7845 invoked by uid 89); 16 May 2013 09:19:19 -0000 X-Spam-SWARE-Status: No, score=-8.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 16 May 2013 09:19:13 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4G9JCuF028334 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 16 May 2013 05:19:12 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r4G9JA1m016155; Thu, 16 May 2013 05:19:11 -0400 Message-ID: <5194A48D.4060806@redhat.com> Date: Thu, 16 May 2013 09:19:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 MIME-Version: 1.0 To: Keith Seitz CC: Sergio Durigan Junior , "gdb-patches@sourceware.org ml" Subject: Re: [RFA] completer test [was Re: [RFC] Cleanup for make_source_files_completion_list] References: <51895A2F.8000504@redhat.com> <5191340B.60100@redhat.com> <519156F5.5090000@redhat.com> <5193C786.4000207@redhat.com> <5193E2DC.5000200@redhat.com> <51941E85.8010104@redhat.com> In-Reply-To: <51941E85.8010104@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-05/txt/msg00580.txt.bz2 On 05/16/2013 12:47 AM, Keith Seitz wrote: > On 05/15/2013 03:33 PM, Sergio Durigan Junior wrote: >> Wouldn't it be better to use the "complete" command? Here is what I see >> when I use it: >> >> (gdb) complete break filesy >> break filesym >> break filesym.c > > Is that necessarily "better" than testing what a user would actually type? I don't know. gdb.base/completion.exp uses both forms. Yeah. Testing just "complete" doesn't cover everything necessary. See thread around: http://sourceware.org/ml/gdb-patches/2011-05/msg00032.html "complete" is useful for frontends, so it's good to test it too. An idea would be to have a mechanism (procedure, whatever) in (or used by) completion.exp that given an input string and the expected completions exercises both "complete" and "\t" with a single call. E.g.,: test_completion "break filesy" { "break" "break filesym.c" } Probably, the completion.exp tests already test the specifics of gdb<->readline interaction that only the \t code paths trigger, independent of specific completer, so for testing specific completers it's probably fine to just go with using the simpler "complete" way only. If we had the mechanism suggested above, then we wouldn't have to think about considering whether all bases are covered though. We'd just always use it. :-) This patch seems to involve testing sort of actual completion mechanics, so it looks like a specific case where testing (at least) the \t variant is good. > This is the first I've heard of send_gdb being deprecated. As far as I can tell, there is no other way to directly test completion this way. I do see, though, that completion.exp uses gdb_test_multiple instead of gdb_expect... If it truly is deprecated, I would expect send_gdb to be made "private" in some way. [deprecated_send_gdb?] Or at least mentioned in lib/gdb.exp. Yeah. Testing completion is one of the cases that need to use it. If we had a higher level mechanism/procedure that simplified \t completion testing, we could hide those send_gdb calls though. :-) > If there is a preference for one or the other [or an actual policy], I will certainly make necessary changes. > > I'm using a similar test strategy for my explicit completion tests, which I am about to submit... Please use gdb_test_multiple. See e.g., how completion.exp itself simplified much when converted to it: http://sourceware.org/ml/gdb-patches/2011-05/msg00063.html -- Pedro Alves