aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_server/src
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2013-06-04 16:16:34 +0200
committerPeter Andersson <[email protected]>2013-06-04 16:17:09 +0200
commit08fffe14651b07ee5ae04c7bdaa29fee21d65a1e (patch)
tree0a39682110ea44278318a26f07ba14a101108f7f /lib/test_server/src
parentcf68fec61294194b47063d2368ff916964e8644d (diff)
parente6b32d2494ccb7a7926844bb9fe4bac6dc65eaa1 (diff)
downloadotp-08fffe14651b07ee5ae04c7bdaa29fee21d65a1e.tar.gz
otp-08fffe14651b07ee5ae04c7bdaa29fee21d65a1e.tar.bz2
otp-08fffe14651b07ee5ae04c7bdaa29fee21d65a1e.zip
Merge remote branch 'origin/peppe/common_test/remove_end_per_tc_warning' into maint
* origin/peppe/common_test/remove_end_per_tc_warning: Remove incorrect warning about missing end_per_testcase OTP-11052
Diffstat (limited to 'lib/test_server/src')
-rw-r--r--lib/test_server/src/test_server.erl13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/test_server/src/test_server.erl b/lib/test_server/src/test_server.erl
index 8b0be51be3..c350f758ce 100644
--- a/lib/test_server/src/test_server.erl
+++ b/lib/test_server/src/test_server.erl
@@ -716,6 +716,16 @@ end_conf_timeout(_, _) ->
call_end_conf(Mod,Func,TCPid,TCExitReason,Loc,Conf,TVal) ->
Starter = self(),
Data = {Mod,Func,TCPid,TCExitReason,Loc},
+ case erlang:function_exported(Mod,end_per_testcase,2) of
+ false ->
+ spawn_link(fun() ->
+ Starter ! {self(),{call_end_conf,Data,ok}}
+ end);
+ true ->
+ do_call_end_conf(Starter,Mod,Func,Data,Conf,TVal)
+ end.
+
+do_call_end_conf(Starter,Mod,Func,Data,Conf,TVal) ->
EndConfProc =
fun() ->
process_flag(trap_exit,true), % to catch timetraps
@@ -753,7 +763,8 @@ call_end_conf(Mod,Func,TCPid,TCExitReason,Loc,Conf,TVal) ->
end,
spawn_link(EndConfProc).
-spawn_fw_call(Mod,{init_per_testcase,Func},CurrConf,Pid,{timetrap_timeout,TVal}=Why,
+spawn_fw_call(Mod,{init_per_testcase,Func},CurrConf,Pid,
+ {timetrap_timeout,TVal}=Why,
Loc,SendTo) ->
FwCall =
fun() ->