Skip to content

Commit

Permalink
Normalise LCOV source paths (#373)
Browse files Browse the repository at this point in the history
Under windows, the git paths use unix-style paths, while the lcov paths use windows-style paths. In addition, coverage.py uses relative paths, but other tools like llvm-cov report absolute paths. So the source paths need to be made relative and unix-style.
  • Loading branch information
matsjoyce-refeyn committed Nov 13, 2023
1 parent 7f8af71 commit 73369d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion diff_cover/violationsreporters/violations_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def parse(lcov_file):
# we're only interested in file name and line coverage
if directive == "SF":
# SF:<absolute path to the source file>
source_file = content
source_file = util.to_unix_path(GitPathTool.relative_path(content))
continue
elif directive == "DA":
# DA:<line number>,<execution count>[,<checksum>]
Expand Down

0 comments on commit 73369d3

Please sign in to comment.