From: Kevin Pouget <kevin.pouget@gmail.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Tom Tromey <tromey@redhat.com>, gdb-patches@sourceware.org
Subject: Re: Dejagnu testing issue
Date: Mon, 24 Oct 2011 09:15:00 -0000 [thread overview]
Message-ID: <CAPftXUJu_9-X1G7t7YEVFSAc5f5ztL-0uKmE+MYQfCB=U_3mEQ@mail.gmail.com> (raw)
In-Reply-To: <20111021083242.GA8363@host1.jankratochvil.net>
On Fri, Oct 21, 2011 at 10:32 AM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> On Fri, 21 Oct 2011 10:14:42 +0200, Kevin Pouget wrote:
>> for the record, here is the way to get the pid based on "expect_out":
>>
>> gdb_test_multiple "info inferior" "list inferiors" {
>> -re ".* \* 1.*process (\[0-9\]*).*$gdb_prompt $" {
>> set pid $expect_out(1,string)
>> pass "list inferiors"
>> }
>> }
>
> While it works to make it working as was intended it could be for example:
>
> gdb_test_multiple "info inferior" "list inferiors" {
> -re "\r\n\\* 1 *process (\[0-9\]*) .*\r\n$gdb_prompt $" {
> set pid $expect_out(1,string)
> pass "list inferiors"
> }
> }
>
> Initial .* is redundant, start of the expect string is not anchored.
>
> \* is equal to * as the first level of backslashes is parsed by TCL
> interpreter, not by the regex compiler.
>
> If one fixes \* -> \\* to really match an asterisk it no longer matches.
> The asterisk is preceded by a newline, not by a space as in your regex string.
Thanks for this precision, the Dejagnu testsuite is not the easiest
tool to master ...
> Initial .* is redundant, start of the expect string is not anchored.
just with this comment, I noticed that a lot of my tests not wrong,
but not correctly written at least, and almost the same for
> If one fixes \* -> \\* to really match an asterisk it no longer matches.
Cordially,
Kevin
prev parent reply other threads:[~2011-10-24 7:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-20 14:56 Kevin Pouget
2011-10-20 15:02 ` Jan Kratochvil
2011-10-20 15:04 ` Tom Tromey
2011-10-21 8:33 ` Kevin Pouget
2011-10-21 8:42 ` Jan Kratochvil
2011-10-24 9:15 ` Kevin Pouget [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='CAPftXUJu_9-X1G7t7YEVFSAc5f5ztL-0uKmE+MYQfCB=U_3mEQ@mail.gmail.com' \
--to=kevin.pouget@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=tromey@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