[RFC Patch] mklog.py: Parse first 10 lines for PR/DR number

Tobias Burnus tobias@codesourcery.com
Tue Sep 8 16:20:36 GMT 2020


On 9/8/20 5:50 PM, Martin Sebor wrote:

> On 9/8/20 3:47 AM, Tobias Burnus wrote:
>> currently, mklog searches for "PR" (and "DR") only in the
>> first line of a new 'testsuite' file.
>>
>> I think in many cases, the PR is listed a bit later than
>> the first line – although, it is usually in the first few
>> lines; in my example, it is in line 3 and 4.
>>
>> Admittedly, I do have cases where later lines are wrong
>> like
>> "! Not tested due to PR ...'
>>
>> How about testing the first, e.g., ten lines?
>> That's what the attached patch does.
>
> I frequently use "prNNNNN" in dg-warning directives xfailed due
> to the pr.

Those won't match pr_regex = re.compile(r'(\/(\/|\*)|[Cc*!])\s+(?P<pr>PR [a-z+-]+\/[0-9]+)')

> They're probably only rarely in the first 10 lines
> but stopping the search after the first dg- directive is seen
> would help reduce the likelihood of the false positives even
> further.

I think stopping after the first 'dg-' directive does not make sense;
at least I tend to start testcases with 'dg-do' followed by
'dg-(additional-)options'.

However, the new version of the patch stops after the first
'dg-error/dg-warning'.

Tobias

-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mklog-v2.diff
Type: text/x-patch
Size: 1684 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200908/a3ffe530/attachment.bin>


More information about the Gcc-patches mailing list