aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2011-02-21 15:44:47 +0100
committerLukas Larsson <[email protected]>2011-02-21 15:51:35 +0100
commit8b8709b08df7444c1d3c1474ae55311505b5b4b5 (patch)
treed7f91362bd743478f0a0f6a1f4808afb6f450518 /lib/common_test
parentd87708bf18d29c0a66f6654368b4553067e62394 (diff)
downloadotp-8b8709b08df7444c1d3c1474ae55311505b5b4b5.tar.gz
otp-8b8709b08df7444c1d3c1474ae55311505b5b4b5.tar.bz2
otp-8b8709b08df7444c1d3c1474ae55311505b5b4b5.zip
Update ct_hooks to fail gracefully when a hook is entered incorrectly in suite/0
Diffstat (limited to 'lib/common_test')
-rw-r--r--lib/common_test/src/ct_hooks.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/common_test/src/ct_hooks.erl b/lib/common_test/src/ct_hooks.erl
index 77b7566d9e..f3984ea46e 100644
--- a/lib/common_test/src/ct_hooks.erl
+++ b/lib/common_test/src/ct_hooks.erl
@@ -66,11 +66,11 @@ terminate(Hooks) ->
init_tc(ct_framework, _Func, Args) ->
Args;
init_tc(Mod, init_per_suite, Config) ->
- Info = case catch proplists:get_value(ct_hooks, Mod:suite()) of
+ Info = case catch proplists:get_value(ct_hooks, Mod:suite(),[]) of
List when is_list(List) ->
[{ct_hooks,List}];
- _Else ->
- []
+ CTHook when is_atom(CTHook) ->
+ [{ct_hooks,[CTHook]}]
end,
call(fun call_generic/3, Config ++ Info, [pre_init_per_suite, Mod]);
init_tc(Mod, end_per_suite, Config) ->