aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src/ct_hooks.erl
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2011-03-09 10:28:47 +0100
committerLukas Larsson <[email protected]>2011-03-09 10:28:47 +0100
commit8c45bb73bfba60c5467798928d55ced6648991c1 (patch)
tree798c6726060d24cdc40782ddded418a133511c0f /lib/common_test/src/ct_hooks.erl
parentf281f2cc52b34bbf5622379a7875b68c54aa7114 (diff)
downloadotp-8c45bb73bfba60c5467798928d55ced6648991c1.tar.gz
otp-8c45bb73bfba60c5467798928d55ced6648991c1.tar.bz2
otp-8c45bb73bfba60c5467798928d55ced6648991c1.zip
Update init_per_suite to not crash when there is no suite/0
Diffstat (limited to 'lib/common_test/src/ct_hooks.erl')
-rw-r--r--lib/common_test/src/ct_hooks.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/common_test/src/ct_hooks.erl b/lib/common_test/src/ct_hooks.erl
index f3984ea46e..6f315d4b82 100644
--- a/lib/common_test/src/ct_hooks.erl
+++ b/lib/common_test/src/ct_hooks.erl
@@ -66,11 +66,13 @@ 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 = try proplists:get_value(ct_hooks, Mod:suite(),[]) of
List when is_list(List) ->
[{ct_hooks,List}];
CTHook when is_atom(CTHook) ->
[{ct_hooks,[CTHook]}]
+ catch error:undef ->
+ [{ct_hooks,[]}]
end,
call(fun call_generic/3, Config ++ Info, [pre_init_per_suite, Mod]);
init_tc(Mod, end_per_suite, Config) ->