瀏覽代碼

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 年之前
父節點
當前提交
af7ba345fa
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. +3
    -0
      src/rebar_prv_cover.erl

+ 3
- 0
src/rebar_prv_cover.erl 查看文件

@ -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…
取消
儲存