From patchwork Wed Mar 26 13:10:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 293 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx20.g.dreamhost.com (caibbdcaaahc.dreamhost.com [208.113.200.72]) by wilcox.dreamhost.com (Postfix) with ESMTP id EA10A360198 for ; Wed, 26 Mar 2014 06:13:10 -0700 (PDT) Received: by homiemail-mx20.g.dreamhost.com (Postfix, from userid 14314964) id 9B63440C1B81D; Wed, 26 Mar 2014 06:13:10 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx20.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx20.g.dreamhost.com (Postfix) with ESMTPS id 76205419925E0 for ; Wed, 26 Mar 2014 06:13:10 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=ho2WkNRAvQ0Fo//v X+Gmx3+GLtwYaCf/Gdxmd2M8J1DCcsjTNmnTdYSQ0A18dbi62r6jkfeA4xuQMYDC /3NUiIQ1vHFzLopzaTqvtPOZwrPoUUf7yDqBNpC/MmWwHq3IeGXJxkVVMNZjhdAb /WLPNQOkiv05QSsLxl6M99NIt4g= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; s=default; bh=g7uoDf9tgVQioN9Goy7+jj YnxGs=; b=YI5WE8ryDu2E45cA9/8s385RzlHeGHTgKQ5GUN74OsfpwoMLFTDqH5 2a4HVx4hmpmzTzh54YinuKYBMH5A20Nd4/hq3PRk4quMwUZc55qVabpbePF3lyq8 51qjqYdYHocrLIZY+qCo6Xx/Tpxu7Tuq+fG6/C0rxb8tghDzSFoK8= 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-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 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 21:10:41 +0800 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> X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in 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. 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 "