Find a replaceable CHECK-like macro. Args: line: line to search on. Returns: (macro name, start position), or (None, -1) if no replaceable macro is found.
(line)
| 4104 | |
| 4105 | |
| 4106 | def FindCheckMacro(line): |
| 4107 | """Find a replaceable CHECK-like macro. |
| 4108 | |
| 4109 | Args: |
| 4110 | line: line to search on. |
| 4111 | Returns: |
| 4112 | (macro name, start position), or (None, -1) if no replaceable |
| 4113 | macro is found. |
| 4114 | """ |
| 4115 | for macro in _CHECK_MACROS: |
| 4116 | i = line.find(macro) |
| 4117 | if i >= 0: |
| 4118 | # Find opening parenthesis. Do a regular expression match here |
| 4119 | # to make sure that we are matching the expected CHECK macro, as |
| 4120 | # opposed to some other macro that happens to contain the CHECK |
| 4121 | # substring. |
| 4122 | matched = Match(r'^(.*\b' + macro + r'\s*)\(', line) |
| 4123 | if not matched: |
| 4124 | continue |
| 4125 | return (macro, len(matched.group(1))) |
| 4126 | return (None, -1) |
| 4127 | |
| 4128 | |
| 4129 | def CheckCheck(filename, clean_lines, linenum, error): |
no test coverage detected
searching dependent graphs…