[zorg] r173940 - Fix for lines of the type: \* TEST '.' FAILED \*

David Blaikie dblaikie at gmail.com
Wed Jan 30 12:21:37 PST 2013


On Wed, Jan 30, 2013 at 12:04 PM, David Dean <david_dean at apple.com> wrote:
> On 30 Jan 2013, at 11:39 AM, David Blaikie <dblaikie at gmail.com> wrote:
>
>> Does this actually work? I would assume it would fail to match the
>> kTestFailureLogStartRE pattern:
>
> The case that was failing was in a simple make check style, but I'm not sure why they didn't match the pattern. Did the pattern change some time ago? I'm seeing it on a branch from a couple of months ago.
>
> The values from debugging it were:
> m.group(0): "******************** TEST 'LLVM :: CodeGen/CellSPU/call.ll' FAILED ********************"
> inFailure[0]: 'LLVM :: CodeGen/CellSPU/call.ll'
>
> So I think it's the logic that was wrong, not the expression.
> If you want to go with the equality check. This would make more sense to me:
>> m.group(2) == self.inFailure[0]

That doesn't seem right (details below)

OK, sorry, I remember/realize now that this is the extra code I added
blind earlier this week - so I understand that there might be bugs in
it. I just don't understand what those bugs are - feel free to provide
some details of the problems you're seeing (rather than me guessing at
what the problems might be based on the changes you're making)

> and should work because I believe that this would be the values here:
>
> m.group(0): "******************** TEST 'LLVM :: CodeGen/CellSPU/call.ll' FAILED ********************"
> m.group(1): "******************** TEST
> m.group(2): 'LLVM :: CodeGen/CellSPU/call.ll'
> m.group(3):  FAILED ********************"

Here's what I'm seeing:

>>> import re
>>> pattern = re.compile(r"""\*{4,80} TEST '(.*)' .*""")
>>> pattern.match("******************** TEST 'LLVM :: CodeGen/CellSPU/call.ll' FAILED ********************").groups()
('LLVM :: CodeGen/CellSPU/call.ll',)

Did the behavior of 'groups' change in some version of python maybe?
(do you see something different when you execute those commands?)

But this group(0) should match the log line exactly - it shouldn't
include quotation marks in either case (the quotations in my example
are just the string literal quotation rendering - not in the actual
string (since the match group is inside the quotation marks in the
pattern))



More information about the llvm-commits mailing list