Wrap cover:stop() call as rebar_cover_utils:exit/0

This commit is contained in:
Tuncer Ayaz 2014-06-14 18:25:38 +02:00
parent 8fea315b0b
commit 1363ba3038
3 changed files with 7 additions and 3 deletions

View file

@ -30,7 +30,8 @@
%% for internal use only %% for internal use only
-export([init/3, -export([init/3,
perform_cover/4, perform_cover/4,
close/1]). close/1,
exit/0]).
-include("rebar.hrl"). -include("rebar.hrl").
@ -52,6 +53,9 @@ close(not_enabled) ->
close(F) -> close(F) ->
ok = file:close(F). ok = file:close(F).
exit() ->
cover:stop().
init(false, _BeamFiles, _TargetDir) -> init(false, _BeamFiles, _TargetDir) ->
{ok, not_enabled}; {ok, not_enabled};
init(true, BeamFiles, TargetDir) -> init(true, BeamFiles, TargetDir) ->

View file

@ -182,7 +182,7 @@ run_eunit(Config, CodePath, SrcErls) ->
%% Stop cover to clean the cover_server state. This is important if we want %% Stop cover to clean the cover_server state. This is important if we want
%% eunit+cover to not slow down when analyzing many Erlang modules. %% eunit+cover to not slow down when analyzing many Erlang modules.
ok = cover:stop(), ok = rebar_cover_utils:exit(),
case EunitResult of case EunitResult of
ok -> ok ->

View file

@ -185,7 +185,7 @@ run1(QC, QCOpts, Config, CodePath, SrcErls) ->
rebar_cover_utils:perform_cover(Config, FilteredModules, SrcModules, rebar_cover_utils:perform_cover(Config, FilteredModules, SrcModules,
qc_dir()), qc_dir()),
rebar_cover_utils:close(CoverLog), rebar_cover_utils:close(CoverLog),
ok = cover:stop(), ok = rebar_cover_utils:exit(),
true = code:set_path(CodePath), true = code:set_path(CodePath),