aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_server/src/test_server.erl
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2010-06-05 18:35:37 +0200
committerRaimo Niskanen <[email protected]>2010-06-09 16:19:24 +0200
commitd3a6ecb105706b66f1c0c6b8a515370df5e29bd3 (patch)
tree99dfc368728fcf89166db7becdcd8b95f4deeb2c /lib/test_server/src/test_server.erl
parentb9e20d9e1f3b47ab5806cd79c16c5609f12453f9 (diff)
downloadotp-d3a6ecb105706b66f1c0c6b8a515370df5e29bd3.tar.gz
otp-d3a6ecb105706b66f1c0c6b8a515370df5e29bd3.tar.bz2
otp-d3a6ecb105706b66f1c0c6b8a515370df5e29bd3.zip
Add support for executing pre-loaded suites (e.g. modules loaded as binaries)
Also fixed bug in test_server that calls end_per_testcase after test case timeout or abortion.
Diffstat (limited to 'lib/test_server/src/test_server.erl')
-rw-r--r--lib/test_server/src/test_server.erl17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/test_server/src/test_server.erl b/lib/test_server/src/test_server.erl
index b70ac08622..d6de907a1b 100644
--- a/lib/test_server/src/test_server.erl
+++ b/lib/test_server/src/test_server.erl
@@ -876,10 +876,19 @@ call_end_conf(Mod,Func,TCPid,TCExitReason,Loc,Conf,TVal) ->
EndConfProc =
fun() ->
Supervisor = self(),
- EndConfApply = fun() ->
- apply(Mod,end_per_testcase,[Func,Conf]),
- Supervisor ! {self(),end_conf}
- end,
+ EndConfApply =
+ fun() ->
+ case catch apply(Mod,end_per_testcase,[Func,Conf]) of
+ {'EXIT',Why} ->
+ group_leader() ! {printout,12,
+ "ERROR! ~p:end_per_testcase(~p, ~p)"
+ " crashed!\n\tReason: ~p\n",
+ [Mod,Func,Conf,Why]};
+ _ ->
+ ok
+ end,
+ Supervisor ! {self(),end_conf}
+ end,
Pid = spawn_link(EndConfApply),
receive
{Pid,end_conf} ->