summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralisdair sullivan <alisdairsullivan@yahoo.ca>2015-02-18 06:22:22 -0800
committeralisdair sullivan <alisdairsullivan@yahoo.ca>2015-02-18 06:33:35 -0800
commita14f75013113f63434a8aa0295ce2be0f0fdedc3 (patch)
treeea8654c115ef827a5440034ad5b4799499141858 /src
parentc64c74e25453c683eaf0591ab046d9fa4def4699 (diff)
fix error where an exception in ct could hang rebar by monitoring
the process where ct is performed
Diffstat (limited to 'src')
-rw-r--r--src/rebar_prv_common_test.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rebar_prv_common_test.erl b/src/rebar_prv_common_test.erl
index a55faa2..b697d37 100644
--- a/src/rebar_prv_common_test.erl
+++ b/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).