(line)
| 94 | |
| 95 | |
| 96 | def normalizeFilepath(line): |
| 97 | # Sometimes the path separators used by compiler and Python can differ, |
| 98 | # so we try to match the path with both forward and backward path |
| 99 | # separators, to make the paths relative to Catch2 repo root. |
| 100 | forwardSlashPath = catchPath.replace('\\', '/') |
| 101 | if forwardSlashPath in line: |
| 102 | line = line.replace(forwardSlashPath + '/', '') |
| 103 | backwardSlashPath = catchPath.replace('/', '\\') |
| 104 | if backwardSlashPath in line: |
| 105 | line = line.replace(backwardSlashPath + '\\', '') |
| 106 | |
| 107 | m = langFilenameParser.match(line) |
| 108 | if m: |
| 109 | filepath = m.group(0) |
| 110 | # go from \ in windows paths to / |
| 111 | filepath = filepath.replace('\\', '/') |
| 112 | # remove start of relative path |
| 113 | filepath = filepath.replace('../', '') |
| 114 | line = line[:m.start()] + filepath + line[m.end():] |
| 115 | |
| 116 | return line |
| 117 | |
| 118 | def filterLine(line, isCompact): |
| 119 | line = normalizeFilepath(line) |
no test coverage detected