Skip to content

Commit

Permalink
Fixed support for sources that are actually recompiled.
Browse files Browse the repository at this point in the history
  • Loading branch information
grigorye committed Oct 10, 2023
1 parent 2c95cf5 commit 1b102c1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/slather/coverage_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ def rate_branches_tested

def source_file_pathname_relative_to_repo_root
test_path=source_file_pathname
if ENV["COVERAGE_PATH_EQUIVALENCE"]
test_path=Pathname("." + "#{source_file_pathname}".delete_prefix(ENV["COVERAGE_PATH_EQUIVALENCE"].delete_suffix(",.")))
equivalence=ENV["COVERAGE_PATH_EQUIVALENCE"]
if equivalence
if source_file_path_name.start_with(equivalence)
test_path=Pathname("." + "#{source_file_pathname}".delete_prefix(equivalence.delete_suffix(",.")))
end
end
test_path.realpath.relative_path_from(Pathname("./").realpath)
end
Expand Down

0 comments on commit 1b102c1

Please sign in to comment.