aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2012-03-15 16:34:49 +0100
committerPeter Andersson <[email protected]>2012-03-19 14:06:57 +0100
commitb411aa5d4e953d719d21f0108edfe20bde08c916 (patch)
tree6c60cfe8f1874c35ea1c75310f74a99753d5c6d1 /lib/common_test/src
parentea23dbfba71bf4bc17fb9c61b19dc3973ccc30f1 (diff)
downloadotp-b411aa5d4e953d719d21f0108edfe20bde08c916.tar.gz
otp-b411aa5d4e953d719d21f0108edfe20bde08c916.tar.bz2
otp-b411aa5d4e953d719d21f0108edfe20bde08c916.zip
Change ct_init/end_per_group to init/end_per_group
OTP-9986
Diffstat (limited to 'lib/common_test/src')
-rw-r--r--lib/common_test/src/ct_framework.erl32
-rw-r--r--lib/common_test/src/ct_hooks.erl13
-rw-r--r--lib/common_test/src/vts.erl4
3 files changed, 11 insertions, 38 deletions
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl
index 1536a5591e..3b46768c8b 100644
--- a/lib/common_test/src/ct_framework.erl
+++ b/lib/common_test/src/ct_framework.erl
@@ -30,7 +30,7 @@
-export([get_logopts/0, format_comment/1, get_html_wrapper/3]).
-export([error_in_suite/1, init_per_suite/1, end_per_suite/1,
- ct_init_per_group/2, ct_end_per_group/2]).
+ init_per_group/2, end_per_group/2]).
-export([make_all_conf/3, make_conf/5]).
@@ -333,8 +333,7 @@ add_defaults1(Mod,Func, GroupPath, SuiteInfo, DoInit) ->
_ -> []
end
end, GroupPath),
- Args = if Func == init_per_group; Func == ct_init_per_group;
- Func == end_per_group; Func == ct_end_per_group ->
+ Args = if Func == init_per_group ; Func == end_per_group ->
[?val(name, hd(GroupPath))];
true ->
[]
@@ -433,7 +432,7 @@ add_defaults2(Mod,init_per_suite, IPSInfo, SuiteInfo,SuiteReqs, false) ->
add_defaults2(Mod,init_per_suite, IPSInfo, SuiteInfo,SuiteReqs, true);
add_defaults2(_Mod,IPG, IPGAndGroupInfo, SuiteInfo,SuiteReqs, DoInit) when
- IPG == init_per_group ; IPG == ct_init_per_group ->
+ IPG == init_per_group ->
%% If DoInit == true, we have to process the suite() list, otherwise
%% it has already been handled (see clause for init_per_suite)
case DoInit of
@@ -476,7 +475,7 @@ add_defaults2(_Mod,_Func, TCAndGroupInfo, SuiteInfo,SuiteReqs, false) ->
add_defaults2(_Mod,_Func, TCInfo, SuiteInfo,SuiteReqs, true) ->
%% Here we have to process the suite info list also (no call to
%% init_per_suite before this first test case). This TC can't belong
- %% to a group, or the clause for (ct_)init_per_group would've caught this.
+ %% to a group, or the clause for init_per_group would've caught this.
Info = lists:flatten([TCInfo, SuiteReqs]),
lists:flatten([Info,remove_info_in_prev(Info, [SuiteInfo])]).
@@ -577,8 +576,6 @@ required_default(Name,Key,Info,_,{init_per_suite,_}) ->
try_set_default(Name,Key,Info,suite);
required_default(Name,Key,Info,_,{{init_per_group,GrName,_},_}) ->
try_set_default(Name,Key,Info,{group,GrName});
-required_default(Name,Key,Info,_,{{ct_init_per_group,GrName,_},_}) ->
- try_set_default(Name,Key,Info,{group,GrName});
required_default(Name,Key,Info,_,_FuncSpec) ->
try_set_default(Name,Key,Info,testcase).
@@ -647,7 +644,7 @@ end_tc(Mod,Func,TCPid,Result,Args,Return) ->
FuncSpec =
case group_or_func(Func,Args) of
{_,GroupName,_Props} = Group ->
- if Func == end_per_group; Func == ct_end_per_group ->
+ if Func == end_per_group ->
ct_config:delete_default_config({group,GroupName});
true -> ok
end,
@@ -872,9 +869,7 @@ mark_as_failed1(_,_,_,[]) ->
ok.
group_or_func(Func, Config) when Func == init_per_group;
- Func == end_per_group;
- Func == ct_init_per_group;
- Func == ct_end_per_group ->
+ Func == end_per_group ->
case ?val(tc_group_properties, Config) of
undefined ->
{Func,unknown,[]};
@@ -1217,8 +1212,8 @@ make_conf(Mod, Name, Props, TestSpec) ->
"end_per_group/2 missing for group "
"~p in ~p, using default.",
[Name,Mod]),
- {{?MODULE,ct_init_per_group},
- {?MODULE,ct_end_per_group},
+ {{?MODULE,init_per_group},
+ {?MODULE,end_per_group},
[{suite,Mod}]}
end,
{conf,[{name,Name}|Props++ExtraProps],InitConf,TestSpec,EndConf}.
@@ -1490,14 +1485,14 @@ end_per_suite(_Config) ->
%% if the group config functions are missing in the suite,
%% use these instead
-ct_init_per_group(GroupName, Config) ->
+init_per_group(GroupName, Config) ->
ct:comment(io_lib:format("start of ~p", [GroupName])),
ct_logs:log("TEST INFO", "init_per_group/2 for ~w missing "
"in suite, using default.",
[GroupName]),
Config.
-ct_end_per_group(GroupName, _) ->
+end_per_group(GroupName, _) ->
ct:comment(io_lib:format("end of ~p", [GroupName])),
ct_logs:log("TEST INFO", "end_per_group/2 for ~w missing "
"in suite, using default.",
@@ -1579,10 +1574,6 @@ report(What,Data) ->
ok;
{end_per_group,_} ->
ok;
- {ct_init_per_group,_} ->
- ok;
- {ct_end_per_group,_} ->
- ok;
{_,ok} ->
add_to_stats(ok);
{_,{skipped,{failed,{_,init_per_testcase,_}}}} ->
@@ -1619,8 +1610,7 @@ report(What,Data) ->
data=Data}),
ct_hooks:on_tc_skip(What, Data),
if Case /= end_per_suite,
- Case /= end_per_group,
- Case /= ct_end_per_group ->
+ Case /= end_per_group ->
add_to_stats(auto_skipped);
true ->
ok
diff --git a/lib/common_test/src/ct_hooks.erl b/lib/common_test/src/ct_hooks.erl
index 026f86c8a7..2a23cd992b 100644
--- a/lib/common_test/src/ct_hooks.erl
+++ b/lib/common_test/src/ct_hooks.erl
@@ -88,11 +88,6 @@ 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]).
@@ -123,14 +118,6 @@ end_tc(Mod, {end_per_group, GroupName, Opts}, Config, Result, _Return) ->
[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').
diff --git a/lib/common_test/src/vts.erl b/lib/common_test/src/vts.erl
index cc8a932887..9dfb0bd6b8 100644
--- a/lib/common_test/src/vts.erl
+++ b/lib/common_test/src/vts.erl
@@ -766,10 +766,6 @@ report1(tc_done,{_Suite,init_per_group,_},State) ->
State;
report1(tc_done,{_Suite,end_per_group,_},State) ->
State;
-report1(tc_done,{_Suite,ct_init_per_group,_},State) ->
- State;
-report1(tc_done,{_Suite,ct_end_per_group,_},State) ->
- State;
report1(tc_done,{_Suite,_Case,ok},State) ->
State#state{ok=State#state.ok+1};
report1(tc_done,{_Suite,_Case,{failed,_Reason}},State) ->