Skip to content

Commit

Permalink
Added cover_opts
Browse files Browse the repository at this point in the history
In rebar.config you can now provide the cover_opts tuple which should contain a proplist with other information. At the moment just the {excl_mods, [my_mod_to_exclude]} option is implemented, which will turn off cover for the modules specified.
  • Loading branch information
dergraf committed Oct 25, 2011
1 parent 28b9ceb commit 3a5bde1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/rebar_eunit.erl
Expand Up @@ -267,7 +267,18 @@ perform_cover(Config, BeamFiles, SrcModules) ->
perform_cover(false, _Config, _BeamFiles, _SrcModules) ->
ok;
perform_cover(true, Config, BeamFiles, SrcModules) ->
cover_analyze(Config, BeamFiles, SrcModules).
CoverOpts = rebar_config:get_list(Config, cover_opts, []),
{NewBeamFiles, NewSrcModules} =
case proplists:get_value(excl_mods, CoverOpts) of
undefined ->
{BeamFiles, SrcModules};
ExclMods ->
{
[lists:delete(M, BeamFiles) || M <- ExclMods],
[lists:delete(M, SrcModules) || M <- ExclMods]
}
end,
cover_analyze(Config, NewBeamFiles, NewSrcModules).

cover_analyze(_Config, [], _SrcModules) ->
ok;
Expand Down

0 comments on commit 3a5bde1

Please sign in to comment.