From patchwork Thu Jun 14 11:51:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 27845 Received: (qmail 57133 invoked by alias); 14 Jun 2018 11:51:21 -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 57123 invoked by uid 89); 14 Jun 2018 11:51:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=sleep, banner, Hx-languages-length:2752 X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 14 Jun 2018 11:51:19 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9500040122BD; Thu, 14 Jun 2018 11:51:17 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB2B020284D6; Thu, 14 Jun 2018 11:51:16 +0000 (UTC) Subject: [pushed] gdb.gdb/selftest.exp, Use multi_line to build gdb's expected startup output (Re: [PATCH, testsuite] Update gdb startup text in selftest.exp) To: Tom de Vries , gdb-patches@sourceware.org, Tom Tromey References: <20180612140945.drjp7rent7mkeoam@localhost.localdomain> <79521339-876f-f14a-c427-79f2e79f994a@redhat.com> From: Pedro Alves Message-ID: <1123408d-fbcd-70f5-af44-2064f8ab91b9@redhat.com> Date: Thu, 14 Jun 2018 12:51:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <79521339-876f-f14a-c427-79f2e79f994a@redhat.com> On 06/13/2018 12:49 PM, Pedro Alves wrote: > That test could be made a lot more readable with use of multi_line. I've pushed this in. From 11ae5818f76e0af4dcf7ee069e0756ccf6901ebe Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 14 Jun 2018 12:25:41 +0100 Subject: [PATCH] gdb.gdb/selftest.exp, Use multi_line to build gdb's expected startup output This regex had to be touched at least twice these past few days. Use multi_line to make it more readable. Note this also tightens the regex a little bit in some spots. gdb/testsuite/ChangeLog: 2018-06-14 Pedro Alves * gdb.gdb/selftest.exp (test_with_self): Use multi_line to build gdb's expected startup output. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.gdb/selftest.exp | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index fd6b8fcbf2f..aa568a8343f 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-06-14 Pedro Alves + + * gdb.gdb/selftest.exp (test_with_self): Use multi_line to build + gdb's expected startup output. + 2018-06-14 Pedro Alves * lib/selftest-support.exp (selftest_setup): Remove inlined diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp index 314bddb8bf2..3b200a28c53 100644 --- a/gdb/testsuite/gdb.gdb/selftest.exp +++ b/gdb/testsuite/gdb.gdb/selftest.exp @@ -63,10 +63,19 @@ proc test_with_self { } { # Wait a bit while the inferior gdb gets to its prompt. sleep 1 } else { + set banner [multi_line \ + "GNU gdb \[0-9\.\]*\[^\r\n\]*" \ + "Copyright \\(C\\) \[0-9\]* Free Software Foundation, Inc\." \ + "License GPLv3\\+: GNU GPL version 3 or later " \ + "This is free software: you are free to change and redistribute it\." \ + "There is NO WARRANTY, to the extent permitted by law\." \ + "Type \"show copying\" and \"show warranty\" for details\." \ + "This GDB was configured as .*" \ + "$gdb_prompt $"] set test "xgdb is at prompt" gdb_test_multiple "continue" $test { -i "$inferior_spawn_id" - -re "GNU gdb \[0-9\.\]*.*Copyright \\(C\\) \[0-9\]* Free Software Foundation, Inc.*License GPLv3\\+: GNU GPL version 3 or later .*This is free software: you are free to change and redistribute it.*There is NO WARRANTY, to the extent permitted by law\..*Type \"show copying\".*and \"show warranty\" for details.*This GDB was configured as .*$gdb_prompt $" { + -re "$banner" { pass $test } }