On 1/12/2015 3:18 PM, Tobias Burnus wrote:
> Hi Joel,
>
> Am 12.01.2015 um 22:04 schrieb Joel Sherrill:
>> That was very close.
>>
>> cat out.txt |  \
>>    perl -e '$in = join("", <STDIN>); if ($in =~ m/^1 2  3(\n|\r\n|\r)1 2
>> 3(\n|\r\n|\r)((\n|\r\n|\r)\*\*\* EXIT code 0)(\n|\r\n|\r)?$/s) { print
>> "matched\n" } else { print "not matched\n" };'
> That won't work on systems which don't print EXIT. You have to move the 
> ")" from after the "0" to before the "?" to make the whole part as 
> optional (the ? applies to the preceding token).

That should be this:

cat out.txt | \
  perl -e '$in = join("", <STDIN>); if ($in =~ m/^1 2  3(\n|\r\n|\r)1 2 
3(\n|\r\n|\r)((\n|\r\n|\r)\*\*\* EXIT code 0(\n|\r\n|\r))?$/s) { print
"matched\n" } else { print "not matched\n" };'


>> I think I mainly fixed the first line to have two spaces between the 2 and 3
>> and added another the EOL pattern at the end.
> The former was a bug (feature) of Thunderbird, which ate the second 
> space, the second, I forgot.
:) I wondered about that when I started this thread. I almost compressed the
files I attached to avoid mailer issues.
>> That just leaves translating that back into DejaGNU/Expect. :)
> Well, that's simple: Either remove all "dg-output" from the test case 
> and add the string between "m/" and "/s" instead of ... in
>
> C { dg-output "..." }
>
> You additionally have to change "\*" to "\\*" and "$" to "\$".
>
> Or, alternatively, only modify the last "dg-output" by replacing "\$" by 
> the string starting with "((" and ending with "$". (Again, you have to 
> replace \* by \\* and $ by \$.)
>
> That should be all. I wonder whether that now works or still fails.
>
> Can you try whether this works (see attachment)?
I tried it and it didn't work. :(
> Tobias

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherr...@oarcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985

Reply via email to