浏览代码

Merge pull request #163 from talentdeficit/monitor_ct

fix error where an exception in ct could hang rebar by monitoring
pull/155/head
Fred Hebert 10 年前
父节点
当前提交
f203bc3c4f
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. +4
    -2
      src/rebar_prv_common_test.erl

+ 4
- 2
src/rebar_prv_common_test.erl 查看文件

@ -76,9 +76,9 @@ run_test(CTOpts, true) ->
run_test(CTOpts, false) ->
Pid = self(),
LogDir = proplists:get_value(logdir, CTOpts),
erlang:spawn(fun() ->
erlang:spawn_monitor(fun() ->
{ok, F} = file:open(filename:join([LogDir, "ct.latest.log"]),
[write]),
[write]),
true = group_leader(F, self()),
Pid ! ct:run_test(CTOpts)
end),
@ -369,4 +369,6 @@ handle_quiet_results(CTOpts, {_, Failed, _}) ->
LogDir = proplists:get_value(logdir, CTOpts),
Index = filename:join([LogDir, "index.html"]),
io:format(" ~p tests failed.~n Results written to ~p.~n", [Failed, Index]);
handle_quiet_results(_CTOpts, {'DOWN', _, _, _, Reason}) ->
handle_results({error, Reason});
handle_quiet_results(_CTOpts, Result) -> handle_results(Result).

正在加载...
取消
保存