Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simark@simark.ca>,
	Philippe Waroquiers <philippe.waroquiers@skynet.be>,
	gdb-patches@sourceware.org
Subject: Re: [RFA] Make test names unique in python.exp and guile.exp
Date: Wed, 24 Jun 2020 12:28:04 +0100	[thread overview]
Message-ID: <640b5439-c693-8310-0819-2fa75eb09af8@redhat.com> (raw)
In-Reply-To: <fee03020-dfb1-14e2-4ecc-74344717262b@simark.ca>

On 6/23/20 10:56 PM, Simon Marchi wrote:
> On 2020-06-23 5:43 p.m., Pedro Alves wrote:
>> On 6/23/20 10:32 PM, Simon Marchi wrote:
>>> On 2020-06-23 4:51 p.m., Philippe Waroquiers via Gdb-patches wrote:
>>>> +	if {[gdb_test_multiple $input "$name - $input" {
>>>> +	    -re "\[\r\n\]*($result)\[\r\n\]+($gdb_prompt | *>)$" {
>>>> +		pass "$name - $input (input nr $inputnr)"
>>>
>>> The test name passed as the second argument of `gdb_test_multiple` and the test
>>> name passed to `pass` should match.  This is why the special variable $gdb_test_name
>>> was added, to avoid potential mismatches.  You can use "pass $gdb_test_name" inside
>>> the gdb_test_multiple body.
>>
>> Text within the "(xxx)" at the end is considered informational, not
>> part of the test name, though.  That's why we avoid trailing parens
>> in general.  So in this case they do match.  Just like these match:
>>
>>  PASS: foo
>>  FAIL: foo (timeout)
>>
>> Still a good idea to write:
>>
>>  pass "$gdb_test_name (input nr $inputnr)"
>>
>> though.
> 
> But here we want to use $inputnr to really differentiate the names of
> the tests, because $input is a command to execute.  So if two commands to
> execute are "end", we would end up with
> 
>   PASS: something - end (input nr 0)
>   PASS: something - end (input nr 1)
> 
> which would be wrongfully considered as the same test.  So I think we need
> inputnr to be part of the test name, not in parenthesis.  Maybe
> 
>   $name: input $inputnr: $input
Hmm, yeah.  I didn't realize that command issues a PASS for each of the
the lines.  That looks good to me.

Thanks,
Pedro Alves



      reply	other threads:[~2020-06-24 11:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 20:51 Philippe Waroquiers
2020-06-23 21:32 ` Simon Marchi
2020-06-23 21:43   ` Pedro Alves
2020-06-23 21:56     ` Simon Marchi
2020-06-24 11:28       ` Pedro Alves [this message]

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=640b5439-c693-8310-0819-2fa75eb09af8@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=philippe.waroquiers@skynet.be \
    --cc=simark@simark.ca \
    /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