Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Pedro Alves <palves@redhat.com>
Cc: Pierre-Marie de Rodat <derodat@adacore.com>,
	GDB Patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Share the "multi_line" helper among all Ada testcases
Date: Wed, 18 Mar 2015 14:12:00 -0000	[thread overview]
Message-ID: <20150318141238.GE7494@adacore.com> (raw)
In-Reply-To: <5509492C.5000604@redhat.com>

> Meanwhile, we grew many tests that do [join [list ... "\r\n"]],
> like this:
> 
> # start by listing all functions
> gdb_test "record function-call-history /ci 1, +20" [join [list \
>   "1\tmain\tinst 1,1" \
>   "2\t  fun4\tinst 2,4" \
>   "3\t    fun1\tinst 5,8" \
>   "4\t  fun4\tinst 9,9" \
>   "5\t    fun2\tinst 10,12" \
>   "6\t      fun1\tinst 13,16" \
>   "7\t    fun2\tinst 17,18" \
>   "8\t  fun4\tinst 19,19" \
>   "9\t    fun3\tinst 20,22" \
>   "10\t      fun1\tinst 23,26" \
>   "11\t    fun3\tinst 27,27" \
>   "12\t      fun2\tinst 28,30" \
>   "13\t        fun1\tinst 31,34" \
>   "14\t      fun2\tinst 35,36" \
>   "15\t    fun3\tinst 37,38" \
>   "16\t  fun4\tinst 39,40" \
>   ] "\r\n"]
> 
> Your multi_line looks like almost the same, except that it's
> a tiny bit more lax:
> 
> proc multi_line { args } {
>     return [join $args "\[\r\n\]*"]
> }
> 
> That will accept _no_ newline between list elements, and
> multiple newlines too.  How about making multi_line join
> with strict "\r\n" too?  Then if you need to match one
> empty line, you can do:
> 
>          [multi_line "line1" \
> 	             ""
>                      "line3"]
> 
> and if you need multiple, you can always do:
> 
>          [multi_line "line1" \
> 	             "\[\r\n\]*"
>                      "lineNN"]

Very good suggestion, I like it! Pierre-Marie?

-- 
Joel


  reply	other threads:[~2015-03-18 14:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-10 11:55 Pierre-Marie de Rodat
2015-03-17 20:08 ` Joel Brobecker
2015-03-18  9:45   ` Pedro Alves
2015-03-18 14:12     ` Joel Brobecker [this message]
2015-03-20 12:18       ` Pierre-Marie de Rodat
2015-03-20 18:00         ` Pedro Alves
2015-04-01  8:50           ` Pierre-Marie de Rodat
2015-04-01 10:26             ` Pedro Alves
2015-04-01 13:08               ` Pierre-Marie de Rodat
2015-07-18  0:35         ` Sergio Durigan Junior
2015-07-20 14:49           ` Pierre-Marie de Rodat
2015-07-20 15:35             ` Sergio Durigan Junior
2015-07-20 22:23               ` Joel Brobecker
2015-07-20 22:42                 ` Sergio Durigan Junior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150318141238.GE7494@adacore.com \
    --to=brobecker@adacore.com \
    --cc=derodat@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox