aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src/ct_hooks.erl
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2012-03-15 00:01:13 +0100
committerPeter Andersson <[email protected]>2012-03-19 14:06:57 +0100
commitea23dbfba71bf4bc17fb9c61b19dc3973ccc30f1 (patch)
tree335dce50e9392105a291a2f66827656288e4951e /lib/common_test/src/ct_hooks.erl
parent37827c8f57036cec67c4d9460c02c468aa615155 (diff)
downloadotp-ea23dbfba71bf4bc17fb9c61b19dc3973ccc30f1.tar.gz
otp-ea23dbfba71bf4bc17fb9c61b19dc3973ccc30f1.tar.bz2
otp-ea23dbfba71bf4bc17fb9c61b19dc3973ccc30f1.zip
Run hooks for non-existing config functions
Diffstat (limited to 'lib/common_test/src/ct_hooks.erl')
-rw-r--r--lib/common_test/src/ct_hooks.erl22
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/common_test/src/ct_hooks.erl b/lib/common_test/src/ct_hooks.erl
index c42adbbdd9..026f86c8a7 100644
--- a/lib/common_test/src/ct_hooks.erl
+++ b/lib/common_test/src/ct_hooks.erl
@@ -70,8 +70,7 @@ terminate(Hooks) ->
{skip, Reason :: term()} |
{auto_skip, Reason :: term()} |
{fail, Reason :: term()}.
-init_tc(ct_framework, _Func, Args) ->
- Args;
+
init_tc(Mod, init_per_suite, Config) ->
Info = try proplists:get_value(ct_hooks, Mod:suite(),[]) of
List when is_list(List) ->
@@ -89,6 +88,11 @@ init_tc(Mod, {init_per_group, GroupName, Opts}, Config) ->
call(fun call_generic/3, Config, [pre_init_per_group, GroupName]);
init_tc(_Mod, {end_per_group, GroupName, _}, Config) ->
call(fun call_generic/3, Config, [pre_end_per_group, GroupName]);
+init_tc(Mod, {ct_init_per_group, GroupName, Opts}, Config) ->
+ maybe_start_locker(Mod, GroupName, Opts),
+ call(fun call_generic/3, Config, [pre_init_per_group, GroupName]);
+init_tc(_Mod, {ct_end_per_group, GroupName, _}, Config) ->
+ call(fun call_generic/3, Config, [pre_end_per_group, GroupName]);
init_tc(_Mod, TC, Config) ->
call(fun call_generic/3, Config, [pre_init_per_testcase, TC]).
@@ -104,27 +108,29 @@ init_tc(_Mod, TC, Config) ->
{auto_skip, Reason :: term()} |
{fail, Reason :: term()} |
ok | '$ct_no_change'.
-end_tc(ct_framework, _Func, _Args, Result, _Return) ->
- Result;
end_tc(Mod, init_per_suite, Config, _Result, Return) ->
call(fun call_generic/3, Return, [post_init_per_suite, Mod, Config],
'$ct_no_change');
-
end_tc(Mod, end_per_suite, Config, Result, _Return) ->
call(fun call_generic/3, Result, [post_end_per_suite, Mod, Config],
'$ct_no_change');
-
end_tc(_Mod, {init_per_group, GroupName, _}, Config, _Result, Return) ->
call(fun call_generic/3, Return, [post_init_per_group, GroupName, Config],
'$ct_no_change');
-
end_tc(Mod, {end_per_group, GroupName, Opts}, Config, Result, _Return) ->
Res = call(fun call_generic/3, Result,
[post_end_per_group, GroupName, Config], '$ct_no_change'),
maybe_stop_locker(Mod, GroupName,Opts),
Res;
-
+end_tc(_Mod, {ct_init_per_group, GroupName, _}, Config, _Result, Return) ->
+ call(fun call_generic/3, Return, [post_init_per_group, GroupName, Config],
+ '$ct_no_change');
+end_tc(Mod, {ct_end_per_group, GroupName, Opts}, Config, Result, _Return) ->
+ Res = call(fun call_generic/3, Result,
+ [post_end_per_group, GroupName, Config], '$ct_no_change'),
+ maybe_stop_locker(Mod, GroupName,Opts),
+ Res;
end_tc(_Mod, TC, Config, Result, _Return) ->
call(fun call_generic/3, Result, [post_end_per_testcase, TC, Config],
'$ct_no_change').