From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15933 invoked by alias); 10 Jan 2013 05:43:56 -0000 Received: (qmail 15681 invoked by uid 22791); 10 Jan 2013 05:43:54 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 10 Jan 2013 05:43:49 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 463E72E3CF; Thu, 10 Jan 2013 00:43:49 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id kcUGiNTAVDsE; Thu, 10 Jan 2013 00:43:49 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id A4DA62E105; Thu, 10 Jan 2013 00:43:48 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id CB9B3C23B1; Thu, 10 Jan 2013 09:43:42 +0400 (RET) Date: Thu, 10 Jan 2013 05:43:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: Yao Qi , gdb-patches@sourceware.org Subject: Re: [PATCH 1/3] Test of breakpoint output for dprintf Message-ID: <20130110054342.GI6143@adacore.com> References: <1355285581-28889-1-git-send-email-yao@codesourcery.com> <1355285581-28889-2-git-send-email-yao@codesourcery.com> <87vcb6w0v7.fsf@fleche.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87vcb6w0v7.fsf@fleche.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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 X-SW-Source: 2013-01/txt/msg00194.txt.bz2 > Yao> +gdb_test "info breakpoints" "3\[\t \]+dprintf .* > Yao> +\[\t \]+printf \"At foo entry\\\\n\". > Yao> +\[\t \]+continue. > Yao> +4\[\t \]+dprintf .* > Yao> +\[\t \]+printf \"arg=%d, g=%d\\\\n\", arg, g. > Yao> +\[\t \]+continue." "dprintf info 1" > > I find this style of test pretty hard to read. > How about using "\n" instead of a newline? > Or writing the string some other way to make it more readable? FWIW, I sometimes do the following when writing tests: gdb_test "info tasks" \ [join {" +ID +TID P-ID Pri State +Name" \ " +1 .* main_task" \ " +2 .* task_list\\(1\\)" \ "\\* +3 .* task_list\\(2\\)" \ " +4 .* task_list\\(3\\)"} \ "\r\n"] \ "info tasks after hitting breakpoint" I find that having a multi-line expected output shown as multiple lines is easier to understand than one ginormous string... -- Joel