소스 검색

Fix handling of {already_started,Pid} from cover:start

Previous patch erroneously assumed that cover:start() returned
{already_started,Pid} in the cases where cover was already started. We
now turn {error,{already_started,Pid}} into {ok, Pid} and return
{error, Reason} if we encounter an error we do not know about, this
will cause a nice and violent badmatch to stop everything.
pull/3/head
David Reid 14 년 전
committed by Tuncer Ayaz
부모
커밋
6736e3147e
1개의 변경된 파일10개의 추가작업 그리고 2개의 파일을 삭제
  1. +10
    -2
      src/rebar_eunit.erl

+ 10
- 2
src/rebar_eunit.erl 파일 보기

@ -288,8 +288,16 @@ cover_init(false, _BeamFiles) ->
cover_init(true, BeamFiles) -> cover_init(true, BeamFiles) ->
%% Attempt to start the cover server, then set it's group leader to %% Attempt to start the cover server, then set it's group leader to
%% .eunit/cover.log, so all cover log messages will go there instead of %% .eunit/cover.log, so all cover log messages will go there instead of
%% to stdout.
{_,CoverPid} = cover:start(),
%% to stdout. If the cover server is already started we'll reuse that
%% pid.
{ok, CoverPid} = case cover:start() of
{ok, P} ->
{ok, P};
{error,{already_started, P}} ->
{ok, P};
{error, Reason} ->
{error, Reason}
end,
{ok, F} = file:open( {ok, F} = file:open(
filename:join([?EUNIT_DIR, "cover.log"]), filename:join([?EUNIT_DIR, "cover.log"]),

불러오는 중...
취소
저장