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 be06263
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/slather/coverage_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,12 @@ 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
orig_prefix=equivalence.delete_suffix(",.")
if "#{source_file_pathname}".start_with?(orig_prefix)
test_path=Pathname("." + "#{source_file_pathname}".delete_prefix(orig_prefix))
end
end
test_path.realpath.relative_path_from(Pathname("./").realpath)
end
Expand Down

0 comments on commit be06263

Please sign in to comment.