From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10237 invoked by alias); 26 Mar 2014 13:13:08 -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 10223 invoked by uid 89); 26 Mar 2014 13:13:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Mar 2014 13:13:04 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1WSndb-000180-R4 from Yao_Qi@mentor.com ; Wed, 26 Mar 2014 06:12:59 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 26 Mar 2014 06:12:59 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.2.247.3; Wed, 26 Mar 2014 06:12:56 -0700 Message-ID: <5332D1D1.20509@codesourcery.com> Date: Wed, 26 Mar 2014 13:13:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Joel Brobecker CC: Subject: Re: [PATCH] Skip tests on completion and readline when readline lib isn't used References: <1395812833-17748-1-git-send-email-yao@codesourcery.com> <20140326123207.GP4282@adacore.com> In-Reply-To: <20140326123207.GP4282@adacore.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-03/txt/msg00609.txt.bz2 On 03/26/2014 08:32 PM, Joel Brobecker wrote: >> +if { ![readline_is_used] } { >> > + # Restore globals modified in this test... >> > + set timeout $oldtimeout1 >> > + return -1 > You actually do not need to restore $timeout. It's automatically > restored at the start of every testcase (see lib/gdb.exp::gdb_init). > OK. >> > >> > +# Return 1 if readline library is used. >> > + >> > +proc readline_is_used { } { >> > + global gdb_prompt >> > + >> > + send_gdb "show editing\n" >> > + gdb_expect { >> > + -re ".*Editing of command lines as they are typed is on\..*$gdb_prompt $" { >> > + return 1 >> > + } >> > + -re ".*$gdb_prompt $" { >> > + return 0 >> > + } > Can you use gdb_test_multiple, in this case? Done. Patch below is pushed in. -- Yao (齐尧) gdb/testsuite: 2014-03-26 Yao Qi * lib/gdb.exp (readline_is_used): New proc. * gdb.base/completion.exp: Move tests on command complete up. Skip the rest of tests if readline is not used. * gdb.ada/complete.exp: Skp the test if readline is not used. * gdb.base/filesym.exp: Likewise. * gdb.base/macscp.exp: Likewise. * gdb.base/readline-ask.exp: Likewise. * gdb.base/readline.exp: Likewise. * gdb.python/py-cmd.exp: Likewise. * gdb.trace/tfile.exp: Likewise. --- gdb/testsuite/ChangeLog | 14 ++++ gdb/testsuite/gdb.ada/complete.exp | 23 ++++--- gdb/testsuite/gdb.base/completion.exp | 121 ++++++++++++++++--------------- gdb/testsuite/gdb.base/filesym.exp | 6 ++ gdb/testsuite/gdb.base/macscp.exp | 119 ++++++++++++++++--------------- gdb/testsuite/gdb.base/readline-ask.exp | 5 ++ gdb/testsuite/gdb.base/readline.exp | 5 ++ gdb/testsuite/gdb.python/py-cmd.exp | 18 +++-- gdb/testsuite/gdb.trace/tfile.exp | 8 ++- gdb/testsuite/lib/gdb.exp | 15 ++++ 10 files changed, 198 insertions(+), 136 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 694efd6..45355f3 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,19 @@ 2014-03-26 Yao Qi + * lib/gdb.exp (readline_is_used): New proc. + * gdb.base/completion.exp: Move tests on command complete up. + Skip the rest of tests if readline is not used. + * gdb.ada/complete.exp: Skp the test if readline is not + used. + * gdb.base/filesym.exp: Likewise. + * gdb.base/macscp.exp: Likewise. + * gdb.base/readline-ask.exp: Likewise. + * gdb.base/readline.exp: Likewise. + * gdb.python/py-cmd.exp: Likewise. + * gdb.trace/tfile.exp: Likewise. + +2014-03-26 Yao Qi + * gdb.base/macscp.exp: Fix code format issues. 2014-03-25 Ulrich Weigand diff --git a/gdb/testsuite/gdb.ada/complete.exp b/gdb/testsuite/gdb.ada/complete.exp index 5b52f73..1e1ebaa 100644 --- a/gdb/testsuite/gdb.ada/complete.exp +++ b/gdb/testsuite/gdb.ada/complete.exp @@ -176,15 +176,18 @@ test_gdb_complete "