aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/test
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common_test/test')
-rw-r--r--lib/common_test/test/ct_suite_callback_SUITE.erl147
-rw-r--r--lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_state_scb_SUITE.erl56
-rw-r--r--lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_state_scb_SUITE.erl47
-rw-r--r--lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_state_scb_SUITE.erl50
4 files changed, 288 insertions, 12 deletions
diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl
index 8d620be7ba..88ce5e0e51 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE.erl
+++ b/lib/common_test/test/ct_suite_callback_SUITE.erl
@@ -70,17 +70,19 @@ all() ->
all(suite).
all(suite) ->
- %% lists:reverse(
+ lists:reverse(
[
one_scb, two_scb, faulty_scb_no_init, faulty_scb_exit_in_init,
faulty_scb_exit_in_init_scope_suite, minimal_scb,
- minimal_and_maximal_scb, faulty_scb_undef, scope_per_suite_scb,
- scope_per_group_scb, scope_suite_scb,
+ minimal_and_maximal_scb, faulty_scb_undef,
+ scope_per_suite_scb, scope_per_group_scb, scope_suite_scb,
+ scope_per_suite_state_scb, scope_per_group_state_scb,
+ scope_suite_state_scb,
fail_pre_suite_scb, fail_post_suite_scb, skip_pre_suite_scb,
skip_post_suite_scb, recover_post_suite_scb, update_config_scb,
- state_update_scb
+ state_update_scb, options_scb
]
- %%)
+ )
.
@@ -136,34 +138,51 @@ scope_per_group_scb(Config) when is_list(Config) ->
do_test(scope_per_group_scb, "ct_scope_per_group_scb_SUITE.erl",
[],Config).
-fail_pre_suite_scb(Config) ->
+scope_per_suite_state_scb(Config) when is_list(Config) ->
+ do_test(scope_per_suite_state_scb, "ct_scope_per_suite_state_scb_SUITE.erl",
+ [],Config).
+
+scope_suite_state_scb(Config) when is_list(Config) ->
+ do_test(scope_suite_state_scb, "ct_scope_suite_state_scb_SUITE.erl",
+ [],Config).
+
+scope_per_group_state_scb(Config) when is_list(Config) ->
+ do_test(scope_per_group_state_scb, "ct_scope_per_group_state_scb_SUITE.erl",
+ [],Config).
+
+fail_pre_suite_scb(Config) when is_list(Config) ->
do_test(fail_pre_suite_scb, "ct_scb_empty_SUITE.erl",
[fail_pre_suite_scb],Config).
-fail_post_suite_scb(Config) ->
+fail_post_suite_scb(Config) when is_list(Config) ->
do_test(fail_post_suite_scb, "ct_scb_empty_SUITE.erl",
[fail_post_suite_scb],Config).
-skip_pre_suite_scb(Config) ->
+skip_pre_suite_scb(Config) when is_list(Config) ->
do_test(skip_pre_suite_scb, "ct_scb_empty_SUITE.erl",
[skip_pre_suite_scb],Config).
-skip_post_suite_scb(Config) ->
+skip_post_suite_scb(Config) when is_list(Config) ->
do_test(skip_post_suite_scb, "ct_scb_empty_SUITE.erl",
[skip_post_suite_scb],Config).
-recover_post_suite_scb(Config) ->
+recover_post_suite_scb(Config) when is_list(Config) ->
do_test(recover_post_suite_scb, "ct_scb_fail_per_suite_SUITE.erl",
[recover_post_suite_scb],Config).
-update_config_scb(Config) ->
+update_config_scb(Config) when is_list(Config) ->
do_test(update_config_scb, "ct_update_config_SUITE.erl",
[update_config_scb],Config).
-state_update_scb(Config) ->
+state_update_scb(Config) when is_list(Config) ->
do_test(state_update_scb, "ct_scb_fail_one_skip_one_SUITE.erl",
[state_update_scb,state_update_scb],Config).
+options_scb(Config) when is_list(Config) ->
+ do_test(options_scb, "ct_scb_empty_SUITE.erl",
+ [{empty_scb,[test]}],Config).
+
+
%%%-----------------------------------------------------------------
%%% HELP FUNCTIONS
%%%-----------------------------------------------------------------
@@ -460,6 +479,83 @@ test_events(scope_per_group_scb) ->
{?eh,stop_logging,[]}
];
+test_events(scope_per_suite_state_scb) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{ct_scope_per_suite_state_scb_SUITE,init_per_suite}},
+ {?eh,scb,{'_',init,[[test]]}},
+ {?eh,scb,{'_',post_init_per_suite,[ct_scope_per_suite_state_scb_SUITE,'$proplist','$proplist',[test]]}},
+ {?eh,tc_done,{ct_scope_per_suite_state_scb_SUITE,init_per_suite,ok}},
+
+ {?eh,tc_start,{ct_scope_per_suite_state_scb_SUITE,test_case}},
+ {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[test]]}},
+ {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[test]]}},
+ {?eh,tc_done,{ct_scope_per_suite_state_scb_SUITE,test_case,ok}},
+
+ {?eh,tc_start,{ct_scope_per_suite_state_scb_SUITE,end_per_suite}},
+ {?eh,scb,{'_',pre_end_per_suite,
+ [ct_scope_per_suite_state_scb_SUITE,'$proplist',[test]]}},
+ {?eh,scb,{'_',post_end_per_suite,[ct_scope_per_suite_state_scb_SUITE,'$proplist','_',[test]]}},
+ {?eh,scb,{'_',terminate,[[test]]}},
+ {?eh,tc_done,{ct_scope_per_suite_state_scb_SUITE,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(scope_suite_state_scb) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{ct_scope_suite_state_scb_SUITE,init_per_suite}},
+ {?eh,scb,{'_',init,[[test]]}},
+ {?eh,scb,{'_',pre_init_per_suite,[ct_scope_suite_state_scb_SUITE,'$proplist',[test]]}},
+ {?eh,scb,{'_',post_init_per_suite,[ct_scope_suite_state_scb_SUITE,'$proplist','$proplist',[test]]}},
+ {?eh,tc_done,{ct_scope_suite_state_scb_SUITE,init_per_suite,ok}},
+
+ {?eh,tc_start,{ct_scope_suite_state_scb_SUITE,test_case}},
+ {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[test]]}},
+ {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[test]]}},
+ {?eh,tc_done,{ct_scope_suite_state_scb_SUITE,test_case,ok}},
+
+ {?eh,tc_start,{ct_scope_suite_state_scb_SUITE,end_per_suite}},
+ {?eh,scb,{'_',pre_end_per_suite,[ct_scope_suite_state_scb_SUITE,'$proplist',[test]]}},
+ {?eh,scb,{'_',post_end_per_suite,[ct_scope_suite_state_scb_SUITE,'$proplist','_',[test]]}},
+ {?eh,scb,{'_',terminate,[[test]]}},
+ {?eh,tc_done,{ct_scope_suite_state_scb_SUITE,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(scope_per_group_state_scb) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{ct_scope_per_group_state_scb_SUITE,init_per_suite}},
+ {?eh,tc_done,{ct_scope_per_group_state_scb_SUITE,init_per_suite,ok}},
+
+ [{?eh,tc_start,{ct_scope_per_group_state_scb_SUITE,{init_per_group,group1,[]}}},
+ {?eh,scb,{'_',init,[[test]]}},
+ {?eh,scb,{'_',post_init_per_group,[group1,'$proplist','$proplist',[test]]}},
+ {?eh,tc_done,{ct_scope_per_group_state_scb_SUITE,{init_per_group,group1,[]},ok}},
+
+ {?eh,tc_start,{ct_scope_per_group_state_scb_SUITE,test_case}},
+ {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[test]]}},
+ {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[test]]}},
+ {?eh,tc_done,{ct_scope_per_group_state_scb_SUITE,test_case,ok}},
+
+ {?eh,tc_start,{ct_scope_per_group_state_scb_SUITE,{end_per_group,group1,[]}}},
+ {?eh,scb,{'_',pre_end_per_group,[group1,'$proplist',[test]]}},
+ {?eh,scb,{'_',post_end_per_group,[group1,'$proplist','_',[test]]}},
+ {?eh,scb,{'_',terminate,[[test]]}},
+ {?eh,tc_done,{ct_scope_per_group_state_scb_SUITE,{end_per_group,group1,[]},ok}}],
+
+ {?eh,tc_start,{ct_scope_per_group_state_scb_SUITE,end_per_suite}},
+ {?eh,tc_done,{ct_scope_per_group_state_scb_SUITE,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}
+ ];
+
test_events(fail_pre_suite_scb) ->
[
{?eh,start_logging,{'DEF','RUNDIR'}},
@@ -753,6 +849,33 @@ test_events(state_update_scb) ->
{?eh,stop_logging,[]}
];
+test_events(options_scb) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,scb,{empty_scb,init,[[test]]}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}},
+ {?eh,scb,{empty_scb,pre_init_per_suite,
+ [ct_scb_empty_SUITE,'$proplist',[test]]}},
+ {?eh,scb,{empty_scb,post_init_per_suite,
+ [ct_scb_empty_SUITE,'$proplist','$proplist',[test]]}},
+ {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}},
+
+ {?eh,tc_start,{ct_scb_empty_SUITE,test_case}},
+ {?eh,scb,{empty_scb,pre_init_per_testcase,[test_case,'$proplist',[test]]}},
+ {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,'$proplist','_',[test]]}},
+ {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}},
+
+ {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}},
+ {?eh,scb,{empty_scb,pre_end_per_suite,
+ [ct_scb_empty_SUITE,'$proplist',[test]]}},
+ {?eh,scb,{empty_scb,post_end_per_suite,[ct_scb_empty_SUITE,'$proplist','_',[test]]}},
+ {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,scb,{empty_scb,terminate,[[test]]}},
+ {?eh,stop_logging,[]}
+ ];
+
test_events(ok) ->
ok.
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_state_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_state_scb_SUITE.erl
new file mode 100644
index 0000000000..63dd767b25
--- /dev/null
+++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_state_scb_SUITE.erl
@@ -0,0 +1,56 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(ct_scope_per_group_state_scb_SUITE).
+
+-suite_defaults([{timetrap, {minutes, 10}}]).
+
+%% Note: This directive should only be used in test suites.
+-compile(export_all).
+
+-include("ct.hrl").
+
+%% Test server callback functions
+init_per_suite(Config) ->
+ Config.
+
+end_per_suite(_Config) ->
+ ok.
+
+init_per_testcase(_TestCase, Config) ->
+ Config.
+
+end_per_testcase(_TestCase, _Config) ->
+ ok.
+
+init_per_group(_GroupName, Config) ->
+ [{suite_callbacks,[{empty_scb,[test]}]}|Config].
+
+end_per_group(_GroupName, _Config) ->
+ ok.
+
+all() ->
+ [{group,group1}].
+
+groups() ->
+ [{group1,[],[test_case]}].
+
+%% Test cases starts here.
+test_case(Config) when is_list(Config) ->
+ ok.
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_state_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_state_scb_SUITE.erl
new file mode 100644
index 0000000000..02a011f91b
--- /dev/null
+++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_state_scb_SUITE.erl
@@ -0,0 +1,47 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(ct_scope_per_suite_state_scb_SUITE).
+
+-suite_defaults([{timetrap, {minutes, 10}}]).
+
+%% Note: This directive should only be used in test suites.
+-compile(export_all).
+
+-include("ct.hrl").
+
+%% Test server callback functions
+init_per_suite(Config) ->
+ [{suite_callbacks,[{empty_scb,[test]}]}|Config].
+
+end_per_suite(_Config) ->
+ ok.
+
+init_per_testcase(_TestCase, Config) ->
+ Config.
+
+end_per_testcase(_TestCase, _Config) ->
+ ok.
+
+all() ->
+ [test_case].
+
+%% Test cases starts here.
+test_case(Config) when is_list(Config) ->
+ ok.
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_state_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_state_scb_SUITE.erl
new file mode 100644
index 0000000000..869532f5cd
--- /dev/null
+++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_state_scb_SUITE.erl
@@ -0,0 +1,50 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(ct_scope_suite_state_scb_SUITE).
+
+-suite_defaults([{timetrap, {minutes, 10}}]).
+
+%% Note: This directive should only be used in test suites.
+-compile(export_all).
+
+-include("ct.hrl").
+
+%% Test server callback functions
+suite() ->
+ [{suite_callbacks,[{empty_scb,[test]}]}].
+
+init_per_suite(Config) ->
+ Config.
+
+end_per_suite(_Config) ->
+ ok.
+
+init_per_testcase(_TestCase, Config) ->
+ Config.
+
+end_per_testcase(_TestCase, _Config) ->
+ ok.
+
+all() ->
+ [test_case].
+
+%% Test cases starts here.
+test_case(Config) when is_list(Config) ->
+ ok.