summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2015-02-18 09:46:07 -0500
committerFred Hebert <mononcqc@ferd.ca>2015-02-18 09:46:07 -0500
commitf203bc3c4fa1727315b96ff0ec4501e35a64e30b (patch)
treeea8654c115ef827a5440034ad5b4799499141858
parentc64c74e25453c683eaf0591ab046d9fa4def4699 (diff)
parenta14f75013113f63434a8aa0295ce2be0f0fdedc3 (diff)
Merge pull request #163 from talentdeficit/monitor_ct
fix error where an exception in ct could hang rebar by monitoring
-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).