diff options
author | Lukas Larsson <[email protected]> | 2010-12-07 19:14:03 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2010-12-08 18:08:28 +0100 |
commit | 8b33f2edabbfd684e619238bbfaa10cc16e2a0a7 (patch) | |
tree | 0ce421dbc6c82cd4aeaefbe0b0f8afac94f2ca09 /lib/common_test | |
parent | 6288b704f2ee0699407f645536ad69e0dd07756d (diff) | |
download | otp-8b33f2edabbfd684e619238bbfaa10cc16e2a0a7.tar.gz otp-8b33f2edabbfd684e619238bbfaa10cc16e2a0a7.tar.bz2 otp-8b33f2edabbfd684e619238bbfaa10cc16e2a0a7.zip |
Fix bug which caused scb to be added too much when initiated in the suite info function
Diffstat (limited to 'lib/common_test')
-rw-r--r-- | lib/common_test/src/ct_framework.erl | 4 | ||||
-rw-r--r-- | lib/common_test/src/ct_suite_callback.erl | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index dbf367e4d8..d05c30f5e1 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -251,7 +251,9 @@ add_defaults(Mod,Func,FuncInfo,DoInit) -> (_) -> false end, SuiteInfo) of true -> - SuiteInfo1 = merge_with_suite_defaults(Mod,SuiteInfo), + SuiteInfoNoSCB = + lists:keydelete(suite_callbacks,1,SuiteInfo), + SuiteInfo1 = merge_with_suite_defaults(Mod,SuiteInfoNoSCB), case add_defaults1(Mod,Func,FuncInfo,SuiteInfo1,DoInit) of Error = {error,_} -> {SuiteInfo1,Error}; MergedInfo -> {SuiteInfo1,MergedInfo} diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl index 46bc250106..4f6bf9942e 100644 --- a/lib/common_test/src/ct_suite_callback.erl +++ b/lib/common_test/src/ct_suite_callback.erl @@ -68,7 +68,13 @@ terminate(Callbacks) -> init_tc(ct_framework, _Func, Args) -> Args; init_tc(Mod, init_per_suite, Config) -> - call(fun call_generic/3, Config, [pre_init_per_suite, Mod]); + Info = case catch proplists:get_value(suite_callbacks, Mod:suite()) of + List when is_list(List) -> + [{suite_callbacks,List}]; + _Else -> + [] + end, + call(fun call_generic/3, Config ++ Info, [pre_init_per_suite, Mod]); init_tc(Mod, end_per_suite, Config) -> call(fun call_generic/3, Config, [pre_end_per_suite, Mod]); init_tc(Mod, {init_per_group, GroupName, Opts}, Config) -> |