diff options
author | Peter Andersson <[email protected]> | 2012-03-16 01:35:21 +0100 |
---|---|---|
committer | Peter Andersson <[email protected]> | 2012-03-19 14:16:04 +0100 |
commit | 2409000567436f33fd912e9a809cc9dda3e9172f (patch) | |
tree | 68441dcdeaed0651f5df141aec38826fcaa566a5 /lib/common_test/src/ct_hooks.erl | |
parent | b411aa5d4e953d719d21f0108edfe20bde08c916 (diff) | |
download | otp-2409000567436f33fd912e9a809cc9dda3e9172f.tar.gz otp-2409000567436f33fd912e9a809cc9dda3e9172f.tar.bz2 otp-2409000567436f33fd912e9a809cc9dda3e9172f.zip |
Use calls to ct_framework:init/end_per_suite for configuration
Now that calls to ct_framework:init/end_per_suite take place
whenever init/end_per_suite is missing in the test suite,
these calls should trigger init/end_tc to perform configuration
(such as calling calling CTH functions, suite/0, etc).
Diffstat (limited to 'lib/common_test/src/ct_hooks.erl')
-rw-r--r-- | lib/common_test/src/ct_hooks.erl | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/common_test/src/ct_hooks.erl b/lib/common_test/src/ct_hooks.erl index 2a23cd992b..8f452ef5e3 100644 --- a/lib/common_test/src/ct_hooks.erl +++ b/lib/common_test/src/ct_hooks.erl @@ -213,10 +213,25 @@ call([{HookId, Fun} | Rest], Config, Meta, Hooks) -> try Hook = lists:keyfind(HookId, #ct_hook_config.id, Hooks), {NewConf, NewHook} = Fun(Hook, Config, Meta), - NewCalls = get_new_hooks(NewConf, Fun), + + %%! --- Fri Mar 16 17:27:25 2012 --- peppe was here! + %%!!?? + NewConf1 = + if is_tuple(NewConf) -> + if element(1, NewConf) == skip; + element(1, NewConf) == fail -> + Config; + true -> + NewConf + end; + true -> + NewConf + end, + + NewCalls = get_new_hooks(NewConf1, Fun), NewHooks = lists:keyreplace(HookId, #ct_hook_config.id, Hooks, NewHook), call(resort(NewCalls ++ Rest,NewHooks,Meta), %% Resort if call_init changed prio - remove(?config_name, NewConf), Meta, + remove(?config_name, NewConf1), Meta, terminate_if_scope_ends(HookId, Meta, NewHooks)) catch throw:{error_in_cth_call,Reason} -> call(Rest, {fail, Reason}, Meta, |