Browse Source

erlang r15x (and possibly earlier) don't put the correct path to

source files in the `compile` key of `module_info/1` so `rebar cover`
struggles locating source in some instances. in these cases a warning
is printed and crappy coverage info is written rather than none at all
pull/202/head
alisdair sullivan 10 years ago
parent
commit
af7ba345fa
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      src/rebar_prv_cover.erl

+ 3
- 0
src/rebar_prv_cover.erl View File

@ -250,6 +250,9 @@ write_index_section(F, [{Section, DataFile, Mods}|Rest]) ->
ok = file:write(F, "</table>\n"),
write_index_section(F, Rest).
%% fix for r15b which doesn't put the correct path in the `source` section
%% of `module_info(compile)`
strip_coverdir([]) -> "";
strip_coverdir(File) ->
filename:join(lists:reverse(lists:sublist(lists:reverse(filename:split(File)),
2))).

Loading…
Cancel
Save