From patchwork Thu Oct 26 17:42:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 23864 Received: (qmail 2284 invoked by alias); 26 Oct 2017 17:42:35 -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 2236 invoked by uid 89); 26 Oct 2017 17:42:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 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=Hx-languages-length:1375 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; Thu, 26 Oct 2017 17:42:33 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B0A3240F04 for ; Thu, 26 Oct 2017 17:42:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B0A3240F04 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves@redhat.com Received: from cascais.lan (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 423F6600CA for ; Thu, 26 Oct 2017 17:42:32 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 4/6] Fix racy output matching in gdb.base/cpcompletion.exp Date: Thu, 26 Oct 2017 18:42:25 +0100 Message-Id: <1509039747-15026-5-git-send-email-palves@redhat.com> In-Reply-To: <1509039747-15026-1-git-send-email-palves@redhat.com> References: <1509039747-15026-1-git-send-email-palves@redhat.com> With: $ make check-read1 TESTS="gdb.cp/cpcompletion.exp" we get (from gdb.log): (gdb) complete break Foo:: break Foo::Foo() break Foo::Foofoo() break Foo::get_foo() break Foo::set_foo(int) break Foo::~Foo() (gdb) FAIL: gdb.cp/cpcompletion.exp: complete class methods (Foo not found) The problem is that the "break ${class}::\[A-Za-z0-9_~\]+" regexp patches partial input, like: break Foo::F break Foo::Fo break Foo::Foo etc. Fix that by expecting each whole line. gdb/testsuite/ChangeLog: yyyy-mm-dd Pedro Alves * gdb.cp/cpcompletion.exp (test_class_complete): Tighten regex to match till end of line. --- gdb/testsuite/gdb.cp/cpcompletion.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.cp/cpcompletion.exp b/gdb/testsuite/gdb.cp/cpcompletion.exp index d4da1d2..c7883ee 100644 --- a/gdb/testsuite/gdb.cp/cpcompletion.exp +++ b/gdb/testsuite/gdb.cp/cpcompletion.exp @@ -26,7 +26,7 @@ proc test_class_complete {class expr name matches} { gdb_test_multiple $cmd $name { "break ${class}::main" { fail "$name (saw global symbol)" } $cmd { exp_continue } - -re "break ${class}::\[A-Za-z0-9_~\]+" { + -re "break ${class}::\[^\r\n\]*\r\n" { set str $expect_out(0,string) scan $str "break ${class}::%\[^(\]" method lappend seen $method