aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/test
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2011-02-09 15:49:32 +0100
committerLukas Larsson <[email protected]>2011-02-17 16:59:39 +0100
commitade343808a1a634bd39ab1c94ecadfd070a189de (patch)
tree8a1b63857edbb91e1f21cc57de129393fdd7748b /lib/common_test/test
parentff8d3f0f39b0d1347cd94e1d0d3ab422ad7b06d7 (diff)
downloadotp-ade343808a1a634bd39ab1c94ecadfd070a189de.tar.gz
otp-ade343808a1a634bd39ab1c94ecadfd070a189de.tar.bz2
otp-ade343808a1a634bd39ab1c94ecadfd070a189de.zip
Rename Suite Callback to Common Test Hook in code and testcases
Diffstat (limited to 'lib/common_test/test')
-rw-r--r--lib/common_test/test/Makefile2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/empty_scb.erl187
-rw-r--r--lib/common_test/test/ct_hooks_SUITE.erl1021
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_id_cth.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_id_scb.erl)6
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_init_cth.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_init_scb.erl)6
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_empty_SUITE.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_empty_SUITE.erl)2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_one_skip_one_SUITE.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_one_skip_one_SUITE.erl)2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_per_suite_SUITE.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_per_suite_SUITE.erl)2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_exit_in_init_scope_suite_cth_SUITE.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_exit_in_init_scope_suite_scb_SUITE.erl)4
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_group_cth_SUITE.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_scb_SUITE.erl)4
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_group_state_cth_SUITE.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_state_scb_SUITE.erl)4
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_suite_cth_SUITE.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_scb_SUITE.erl)4
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_suite_state_cth_SUITE.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_state_scb_SUITE.erl)4
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_tc_cth_SUITE.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_tc_scb_SUITE.erl)4
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_cth_SUITE.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_scb_SUITE.erl)4
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_state_cth_SUITE.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_state_scb_SUITE.erl)4
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_update_config_SUITE.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_update_config_SUITE.erl)0
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl)58
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_post_suite_cth.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_pre_suite_scb.erl)34
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_pre_suite_cth.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_post_suite_scb.erl)34
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/id_no_init_cth.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/id_no_init_scb.erl)6
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_cth.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_scb.erl)6
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_terminate_cth.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_terminate_scb.erl)8
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/recover_post_suite_cth.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/recover_post_suite_scb.erl)34
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/same_id_cth.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/same_id_scb.erl)34
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_post_suite_cth.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_post_suite_scb.erl)32
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_suite_cth.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_pre_suite_scb.erl)32
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/state_update_cth.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/state_update_scb.erl)32
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/undef_cth.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl)30
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl (renamed from lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/update_config_scb.erl)32
-rw-r--r--lib/common_test/test/ct_suite_callback_SUITE.erl1021
31 files changed, 1233 insertions, 1420 deletions
diff --git a/lib/common_test/test/Makefile b/lib/common_test/test/Makefile
index 28be9f56f1..be4b4c32b8 100644
--- a/lib/common_test/test/Makefile
+++ b/lib/common_test/test/Makefile
@@ -41,7 +41,7 @@ MODULES= \
ct_config_SUITE \
ct_master_SUITE \
ct_misc_1_SUITE \
- ct_suite_callback_SUITE
+ ct_hooks_SUITE
ERL_FILES= $(MODULES:%=%.erl)
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/empty_scb.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/empty_scb.erl
deleted file mode 100644
index 41808b4f1d..0000000000
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/empty_scb.erl
+++ /dev/null
@@ -1,187 +0,0 @@
-%%
-%% %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%
-%%
-
-%%% @doc Common Test Example Suite Callback module.
-%%%
-%%% <p>This module gives an example of a common test SCB (Suite CallBack).
-%%% There are many ways to add a SCB to a test run, you can do it either in
-%%% the command line using -suite_callback, in a test spec using
-%%% {suite_callback,M} or in the suite it self by returning suite_callback
-%%% from either suite/0, init_per_suite/1, init_per_group/2 and
-%%% init_per_testcase/2. The scope of the SCB is determined by where is it
-%%% started. If it is started in the command line or test spec then it will
-%%% be stopped at the end of all tests. If it is started in init_per_suite,
-%%% it will be stopped after end_per_suite and so on. See terminate
-%%% documentation for a table describing the scoping machanics.
-%%%
-%%% All of callbacks except init/1 in a SCB are optional.</p>
-
--module(empty_scb).
-
-%% Suite Callbacks
--export([init/1]).
-
--export([pre_init_suite/3]).
--export([post_init_suite/3]).
--export([pre_end_suite/3]).
--export([post_end_suite/3]).
-
--export([pre_init_group/3]).
--export([post_init_group/3]).
--export([pre_end_group/3]).
--export([post_end_group/3]).
-
--export([pre_init_tc/3]).
--export([post_end_tc/3]).
-
--export([on_tc_fail/3]).
-
--export([terminate/2]).
-
--type proplist() :: list({atom(),term()}).
--type config() :: proplist().
--type reason() :: term().
--type skip_or_fail() :: {skip, reason()} |
- {auto_skip, reason()} |
- {fail, reason()}.
-
--record(state, { id = ?MODULE :: term()}).
-
-%% @doc Always called before any other callback function. Use this to initiate
-%% any common state. It should return an ID for this SCB and a state. The ID
-%% is used to uniquly identify an SCB instance, if two SCB's return the same
-%% ID the seconds SCB is ignored. This function should NOT have any side
-%% effects as it might be called multiple times by common test.
--spec init(Opts :: proplist()) ->
- {Id :: term(), State :: #state{}}.
-init(Opts) ->
- {?MODULE, #state{ }}.
-
-%% @doc Called before init_per_suite is called. Note that this callback is
-%% only called if the SCB is added before init_per_suite is run (eg. in a test
-%% specification, suite/0 function etc).
-%% You can change the config in the this function.
--spec pre_init_suite(Suite :: atom(),
- Config :: config(),
- State :: #state{}) ->
- {config() | skip_or_fail(), NewState :: #state{}}.
-pre_init_suite(Suite,Config,State) ->
- {Config, State}.
-
-%% @doc Called after init_per_suite.
-%% you can change the config in this function.
--spec post_init_suite(Suite :: atom(),
- Config :: config(),
- State :: #state{}) ->
- {config() | skip_or_fail(), NewState :: #state{}}.
-post_init_suite(Suite,Config,State) ->
- {Config, State}.
-
-%% @doc Called before end_per_suite. Note that the config cannot be
-%% changed here, only the status of the suite.
--spec pre_end_suite(Suite :: atom(),
- Config :: config(),
- State :: #state{}) ->
- {ok | skip_or_fail(), NewState :: #state{}}.
-pre_end_suite(Suite,Config,State) -> {Config, State}.
-
-%% @doc Called after end_per_suite. Note that the config cannot be
-%% changed here, only the status of the suite.
--spec post_end_suite(Suite :: atom(),
- Config :: config(),
- State :: #state{}) ->
- {ok | skip_or_fail(), NewState :: #state{}}.
-post_end_suite(Suite,Config,State) -> {Config, State}.
-
-%% @doc Called before each init_per_group.
-%% You can change the config in this function.
--spec pre_init_group(Group :: atom(),
- Config :: config(),
- State :: #state{}) ->
- {config() | skip_or_fail(), NewState :: #state{}}.
-pre_init_group(Group,Config,State) -> {Config, State}.
-
-%% @doc Called after each init_per_group.
-%% You can change the config in this function.
--spec post_init_group(Group :: atom(),
- Config :: config(),
- State :: #state{}) ->
- {config() | skip_or_fail(), NewState :: #state{}}.
-post_init_group(Group,Config,State) -> {Config, State}.
-
-%% @doc Called after each end_per_group. Note that the config cannot be
-%% changed here, only the status of the group.
--spec pre_end_group(Group :: atom(),
- Config :: config(),
- State :: #state{}) ->
- {ok | skip_or_fail(), NewState :: #state{}}.
-pre_end_group(Group,Config,State) -> {Config, State}.
-
-%% @doc Called after each end_per_group. Note that the config cannot be
-%% changed here, only the status of the group.
--spec post_end_group(Group :: atom(),
- Config :: config(),
- State :: #state{}) ->
- {ok | skip_or_fail(), NewState :: #state{}}.
-post_end_group(Group,Config,State) -> {Config, State}.
-
-%% @doc Called before each test case.
-%% You can change the config in this function.
--spec pre_init_tc(TC :: atom(),
- Config :: config(),
- State :: #state{}) ->
- {config() | skip_or_fail(), NewState :: #state{}}.
-pre_init_tc(TC,Config,State) -> {Config, State}.
-
-%% @doc Called after each test case. Note that the config cannot be
-%% changed here, only the status of the test case.
--spec post_end_tc(TC :: atom(),
- Config :: config(),
- State :: #state{}) ->
- {ok | skip_or_fail(), NewState :: #state{}}.
-post_end_tc(TC,Config,State) -> {Config, State}.
-
-%% @doc Called after post_init_suite, post_end_suite, post_init_group,
-%% post_end_group and post_end_tc if the suite, group or test case failed.
-%% This function should be used for extra cleanup which might be needed.
-%% It is not possible to modify the config or the status of the test run.
--spec on_tc_fail(TC :: init_per_suite | end_per_suite |
- init_per_group | end_per_group | atom(),
- Config :: config(), State :: #state{}) ->
- ok.
-on_tc_fail(_TC, _Config, _State) ->
- ok.
-
-%% @doc Called when the scope of the SCB is done, this depends on
-%% when the SCB was specified. This translation table describes when this
-%% function is called.
-%%
-%% | Started in | terminate called |
-%% |---------------------|-------------------------|
-%% | command_line | after all tests are run |
-%% | test spec | after all tests are run |
-%% | suite/0 | after SUITE is done |
-%% | init_per_suite/1 | after SUITE is done |
-%% | init_per_group/2 | after group is done |
-%% | init_per_testcase/2 | after test case is done |
-%% |-----------------------------------------------|
-%%
--spec terminate(Config :: proplist(), State :: #state{}) ->
- term().
-terminate(Config,State) -> {Config, State}.
diff --git a/lib/common_test/test/ct_hooks_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE.erl
new file mode 100644
index 0000000000..1e187aa205
--- /dev/null
+++ b/lib/common_test/test/ct_hooks_SUITE.erl
@@ -0,0 +1,1021 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2009-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%
+%%
+
+%%%-------------------------------------------------------------------
+%%% File: ct_error_SUITE
+%%%
+%%% Description:
+%%% Test various errors in Common Test suites.
+%%%
+%%% The suites used for the test are located in the data directory.
+%%%-------------------------------------------------------------------
+-module(ct_hooks_SUITE).
+
+-compile(export_all).
+
+-include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+-define(eh, ct_test_support_eh).
+
+%%--------------------------------------------------------------------
+%% TEST SERVER CALLBACK FUNCTIONS
+%%--------------------------------------------------------------------
+
+%%--------------------------------------------------------------------
+%% Description: Since Common Test starts another Test Server
+%% instance, the tests need to be performed on a separate node (or
+%% there will be clashes with logging processes etc).
+%%--------------------------------------------------------------------
+init_per_suite(Config) ->
+ DataDir = ?config(data_dir, Config),
+ TestDir = filename:join(DataDir,"cth/tests/"),
+ CTHs = filelib:wildcard(filename:join(TestDir,"*_cth.erl")),
+ io:format("CTHs: ~p",[CTHs]),
+ [io:format("Compiling ~p: ~p",
+ [FileName,compile:file(FileName,[{outdir,TestDir},debug_info])]) ||
+ FileName <- CTHs],
+ ct_test_support:init_per_suite([{path_dirs,[TestDir]} | Config]).
+
+end_per_suite(Config) ->
+ ct_test_support:end_per_suite(Config).
+
+init_per_testcase(TestCase, Config) ->
+ ct_test_support:init_per_testcase(TestCase, Config).
+
+end_per_testcase(TestCase, Config) ->
+ ct_test_support:end_per_testcase(TestCase, Config).
+
+
+suite() ->
+ [{timetrap,{seconds,20}}].
+
+all() ->
+ all(suite).
+
+all(suite) ->
+ lists:reverse(
+ [
+ one_cth, two_cth, faulty_cth_no_init, faulty_cth_id_no_init,
+ faulty_cth_exit_in_init, faulty_cth_exit_in_id,
+ faulty_cth_exit_in_init_scope_suite, minimal_cth,
+ minimal_and_maximal_cth, faulty_cth_undef,
+ scope_per_suite_cth, scope_per_group_cth, scope_suite_cth,
+ scope_per_suite_state_cth, scope_per_group_state_cth,
+ scope_suite_state_cth,
+ fail_pre_suite_cth, fail_post_suite_cth, skip_pre_suite_cth,
+ skip_post_suite_cth, recover_post_suite_cth, update_config_cth,
+ state_update_cth, options_cth, same_id_cth,
+ fail_n_skip_with_minimal_cth
+ ]
+ )
+ .
+
+
+%%--------------------------------------------------------------------
+%% TEST CASES
+%%--------------------------------------------------------------------
+
+%%%-----------------------------------------------------------------
+%%%
+one_cth(Config) when is_list(Config) ->
+ do_test(one_empty_cth, "ct_cth_empty_SUITE.erl",[empty_cth], Config).
+
+two_cth(Config) when is_list(Config) ->
+ do_test(two_empty_cth, "ct_cth_empty_SUITE.erl",[empty_cth,empty_cth],
+ Config).
+
+faulty_cth_no_init(Config) when is_list(Config) ->
+ do_test(faulty_cth_no_init, "ct_cth_empty_SUITE.erl",[askjhdkljashdkaj],
+ Config,{error,"Failed to start CTH, see the "
+ "CT Log for details"}).
+
+faulty_cth_id_no_init(Config) when is_list(Config) ->
+ do_test(faulty_cth_id_no_init, "ct_cth_empty_SUITE.erl",[id_no_init_cth],
+ Config,{error,"Failed to start CTH, see the "
+ "CT Log for details"}).
+
+minimal_cth(Config) when is_list(Config) ->
+ do_test(minimal_cth, "ct_cth_empty_SUITE.erl",[minimal_cth],Config).
+
+minimal_and_maximal_cth(Config) when is_list(Config) ->
+ do_test(minimal_and_maximal_cth, "ct_cth_empty_SUITE.erl",
+ [minimal_cth, empty_cth],Config).
+
+faulty_cth_undef(Config) when is_list(Config) ->
+ do_test(faulty_cth_undef, "ct_cth_empty_SUITE.erl",
+ [undef_cth],Config).
+
+faulty_cth_exit_in_init_scope_suite(Config) when is_list(Config) ->
+ do_test(faulty_cth_exit_in_init_scope_suite,
+ "ct_exit_in_init_scope_suite_cth_SUITE.erl",
+ [],Config).
+
+faulty_cth_exit_in_init(Config) when is_list(Config) ->
+ do_test(faulty_cth_exit_in_init, "ct_cth_empty_SUITE.erl",
+ [crash_init_cth], Config,
+ {error,"Failed to start CTH, see the "
+ "CT Log for details"}).
+
+faulty_cth_exit_in_id(Config) when is_list(Config) ->
+ do_test(faulty_cth_exit_in_id, "ct_cth_empty_SUITE.erl",
+ [crash_id_cth], Config,
+ {error,"Failed to start CTH, see the "
+ "CT Log for details"}).
+
+scope_per_suite_cth(Config) when is_list(Config) ->
+ do_test(scope_per_suite_cth, "ct_scope_per_suite_cth_SUITE.erl",
+ [],Config).
+
+scope_suite_cth(Config) when is_list(Config) ->
+ do_test(scope_suite_cth, "ct_scope_suite_cth_SUITE.erl",
+ [],Config).
+
+scope_per_group_cth(Config) when is_list(Config) ->
+ do_test(scope_per_group_cth, "ct_scope_per_group_cth_SUITE.erl",
+ [],Config).
+
+scope_per_suite_state_cth(Config) when is_list(Config) ->
+ do_test(scope_per_suite_state_cth, "ct_scope_per_suite_state_cth_SUITE.erl",
+ [],Config).
+
+scope_suite_state_cth(Config) when is_list(Config) ->
+ do_test(scope_suite_state_cth, "ct_scope_suite_state_cth_SUITE.erl",
+ [],Config).
+
+scope_per_group_state_cth(Config) when is_list(Config) ->
+ do_test(scope_per_group_state_cth, "ct_scope_per_group_state_cth_SUITE.erl",
+ [],Config).
+
+fail_pre_suite_cth(Config) when is_list(Config) ->
+ do_test(fail_pre_suite_cth, "ct_cth_empty_SUITE.erl",
+ [fail_pre_suite_cth],Config).
+
+fail_post_suite_cth(Config) when is_list(Config) ->
+ do_test(fail_post_suite_cth, "ct_cth_empty_SUITE.erl",
+ [fail_post_suite_cth],Config).
+
+skip_pre_suite_cth(Config) when is_list(Config) ->
+ do_test(skip_pre_suite_cth, "ct_cth_empty_SUITE.erl",
+ [skip_pre_suite_cth],Config).
+
+skip_post_suite_cth(Config) when is_list(Config) ->
+ do_test(skip_post_suite_cth, "ct_cth_empty_SUITE.erl",
+ [skip_post_suite_cth],Config).
+
+recover_post_suite_cth(Config) when is_list(Config) ->
+ do_test(recover_post_suite_cth, "ct_cth_fail_per_suite_SUITE.erl",
+ [recover_post_suite_cth],Config).
+
+update_config_cth(Config) when is_list(Config) ->
+ do_test(update_config_cth, "ct_update_config_SUITE.erl",
+ [update_config_cth],Config).
+
+state_update_cth(Config) when is_list(Config) ->
+ do_test(state_update_cth, "ct_cth_fail_one_skip_one_SUITE.erl",
+ [state_update_cth,state_update_cth],Config).
+
+options_cth(Config) when is_list(Config) ->
+ do_test(options_cth, "ct_cth_empty_SUITE.erl",
+ [{empty_cth,[test]}],Config).
+
+same_id_cth(Config) when is_list(Config) ->
+ do_test(same_id_cth, "ct_cth_empty_SUITE.erl",
+ [same_id_cth,same_id_cth],Config).
+
+fail_n_skip_with_minimal_cth(Config) when is_list(Config) ->
+ do_test(fail_n_skip_with_minimal_cth, "ct_cth_fail_one_skip_one_SUITE.erl",
+ [minimal_terminate_cth],Config).
+
+%%%-----------------------------------------------------------------
+%%% HELP FUNCTIONS
+%%%-----------------------------------------------------------------
+
+do_test(Tag, SWC, CTHs, Config) ->
+ do_test(Tag, SWC, CTHs, Config, ok).
+do_test(Tag, SWC, CTHs, Config, {error,_} = Res) ->
+ do_test(Tag, SWC, CTHs, Config, Res, 1);
+do_test(Tag, SWC, CTHs, Config, Res) ->
+ do_test(Tag, SWC, CTHs, Config, Res, 2).
+
+do_test(Tag, SuiteWildCard, CTHs, Config, Res, EC) ->
+
+ DataDir = ?config(data_dir, Config),
+ Suites = filelib:wildcard(
+ filename:join([DataDir,"cth/tests",SuiteWildCard])),
+ {Opts,ERPid} = setup([{suite,Suites},
+ {ct_hooks,CTHs},{label,Tag}], Config),
+ Res = ct_test_support:run(Opts, Config),
+ Events = ct_test_support:get_events(ERPid, Config),
+
+ ct_test_support:log_events(Tag,
+ reformat(Events, ?eh),
+ ?config(priv_dir, Config)),
+
+ TestEvents = events_to_check(Tag, EC),
+ ok = ct_test_support:verify_events(TestEvents, Events, Config).
+
+setup(Test, Config) ->
+ Opts0 = ct_test_support:get_opts(Config),
+ Level = ?config(trace_level, Config),
+ EvHArgs = [{cbm,ct_test_support},{trace_level,Level}],
+ Opts = Opts0 ++ [{event_handler,{?eh,EvHArgs}}|Test],
+ ERPid = ct_test_support:start_event_receiver(Config),
+ {Opts,ERPid}.
+
+reformat(Events, EH) ->
+ ct_test_support:reformat(Events, EH).
+%reformat(Events, _EH) ->
+% Events.
+
+%%%-----------------------------------------------------------------
+%%% TEST EVENTS
+%%%-----------------------------------------------------------------
+events_to_check(Test) ->
+ %% 2 tests (ct:run_test + script_start) is default
+ events_to_check(Test, 2).
+
+events_to_check(_, 0) ->
+ [];
+events_to_check(Test, N) ->
+ test_events(Test) ++ events_to_check(Test, N-1).
+
+test_events(one_empty_cth) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,cth,{empty_cth,id,[[]]}},
+ {?eh,cth,{empty_cth,init,[{'_','_','_'},[]]}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{ct_cth_empty_SUITE,init_per_suite}},
+ {?eh,cth,{empty_cth,pre_init_per_suite,
+ [ct_cth_empty_SUITE,'$proplist',[]]}},
+ {?eh,cth,{empty_cth,post_init_per_suite,
+ [ct_cth_empty_SUITE,'$proplist','$proplist',[]]}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,init_per_suite,ok}},
+
+ {?eh,tc_start,{ct_cth_empty_SUITE,test_case}},
+ {?eh,cth,{empty_cth,pre_init_per_testcase,[test_case,'$proplist',[]]}},
+ {?eh,cth,{empty_cth,post_end_per_testcase,[test_case,'$proplist','_',[]]}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,test_case,ok}},
+
+ {?eh,tc_start,{ct_cth_empty_SUITE,end_per_suite}},
+ {?eh,cth,{empty_cth,pre_end_per_suite,
+ [ct_cth_empty_SUITE,'$proplist',[]]}},
+ {?eh,cth,{empty_cth,post_end_per_suite,[ct_cth_empty_SUITE,'$proplist','_',[]]}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,cth,{empty_cth,terminate,[[]]}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(two_empty_cth) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,cth,{'_',id,[[]]}},
+ {?eh,cth,{'_',init,['_',[]]}},
+ {?eh,cth,{'_',id,[[]]}},
+ {?eh,cth,{'_',init,['_',[]]}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{ct_cth_empty_SUITE,init_per_suite}},
+ {?eh,cth,{'_',pre_init_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}},
+ {?eh,cth,{'_',pre_init_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}},
+ {?eh,cth,{'_',post_init_per_suite,[ct_cth_empty_SUITE,'$proplist','$proplist',[]]}},
+ {?eh,cth,{'_',post_init_per_suite,[ct_cth_empty_SUITE,'$proplist','$proplist',[]]}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,init_per_suite,ok}},
+
+ {?eh,tc_start,{ct_cth_empty_SUITE,test_case}},
+ {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}},
+ {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}},
+ {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}},
+ {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,test_case,ok}},
+
+ {?eh,tc_start,{ct_cth_empty_SUITE,end_per_suite}},
+ {?eh,cth,{'_',pre_end_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}},
+ {?eh,cth,{'_',pre_end_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}},
+ {?eh,cth,{'_',post_end_per_suite,[ct_cth_empty_SUITE,'$proplist','_',[]]}},
+ {?eh,cth,{'_',post_end_per_suite,[ct_cth_empty_SUITE,'$proplist','_',[]]}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,cth,{'_',terminate,[[]]}},
+ {?eh,cth,{'_',terminate,[[]]}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(faulty_cth_no_init) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(faulty_cth_id_no_init) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,cth,{'_',id,[[]]}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {negative,{?eh,tc_start,'_'},
+ {?eh,test_done,{'DEF','STOP_TIME'}}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(minimal_cth) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {negative,{?eh,cth,{'_',id,['_',[]]}},
+ {?eh,cth,{'_',init,['_',[]]}}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{ct_cth_empty_SUITE,init_per_suite}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,init_per_suite,ok}},
+
+ {?eh,tc_start,{ct_cth_empty_SUITE,test_case}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,test_case,ok}},
+
+ {?eh,tc_start,{ct_cth_empty_SUITE,end_per_suite}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(minimal_and_maximal_cth) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {negative,{?eh,cth,{'_',id,['_',[]]}},
+ {?eh,cth,{'_',init,['_',[]]}}},
+ {?eh,cth,{'_',id,[[]]}},
+ {?eh,cth,{'_',init,['_',[]]}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{ct_cth_empty_SUITE,init_per_suite}},
+ {?eh,cth,{'_',pre_init_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}},
+ {?eh,cth,{'_',post_init_per_suite,[ct_cth_empty_SUITE,'$proplist','$proplist',[]]}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,init_per_suite,ok}},
+
+ {?eh,tc_start,{ct_cth_empty_SUITE,test_case}},
+ {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}},
+ {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,test_case,ok}},
+
+ {?eh,tc_start,{ct_cth_empty_SUITE,end_per_suite}},
+ {?eh,cth,{'_',pre_end_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}},
+ {?eh,cth,{'_',post_end_per_suite,[ct_cth_empty_SUITE,'$proplist','_',[]]}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,cth,{'_',terminate,[[]]}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(faulty_cth_undef) ->
+ FailReasonStr = "undef_cth:pre_init_per_suite/3 CTH call failed",
+ FailReason = {ct_cth_empty_SUITE,init_per_suite,
+ {failed,FailReasonStr}},
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,cth,{'_',init,['_',[]]}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{ct_cth_empty_SUITE,init_per_suite}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,init_per_suite,
+ {failed, {error,FailReasonStr}}}},
+ {?eh,cth,{'_',on_tc_fail,'_'}},
+
+ {?eh,tc_auto_skip,{ct_cth_empty_SUITE,test_case,
+ {failed, FailReason}}},
+ {?eh,cth,{'_',on_tc_skip,'_'}},
+
+ {?eh,tc_auto_skip,{ct_cth_empty_SUITE,end_per_suite,
+ {failed, FailReason}}},
+ {?eh,cth,{'_',on_tc_skip,'_'}},
+
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(faulty_cth_exit_in_init_scope_suite) ->
+ [{?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{'_',init_per_suite}},
+ {?eh,cth,{empty_cth,init,['_',[]]}},
+ {?eh,tc_done,
+ {ct_exit_in_init_scope_suite_cth_SUITE,init_per_suite,
+ {failed,
+ {error,
+ "Failed to start CTH, see the CT Log for details"}}}},
+ {?eh,tc_auto_skip,
+ {ct_exit_in_init_scope_suite_cth_SUITE,test_case,
+ {failed,
+ {ct_exit_in_init_scope_suite_cth_SUITE,init_per_suite,
+ {failed,
+ "Failed to start CTH, see the CT Log for details"}}}}},
+ {?eh,tc_auto_skip,
+ {ct_exit_in_init_scope_suite_cth_SUITE,end_per_suite,
+ {failed,
+ {ct_exit_in_init_scope_suite_cth_SUITE,init_per_suite,
+ {failed,
+ "Failed to start CTH, see the CT Log for details"}}}}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}];
+
+test_events(faulty_cth_exit_in_init) ->
+ [{?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,cth,{empty_cth,init,['_',[]]}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}];
+
+test_events(faulty_cth_exit_in_id) ->
+ [{?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,cth,{empty_cth,id,[[]]}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {negative, {?eh,tc_start,'_'},
+ {?eh,test_done,{'DEF','STOP_TIME'}}},
+ {?eh,stop_logging,[]}];
+
+test_events(scope_per_suite_cth) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{ct_scope_per_suite_cth_SUITE,init_per_suite}},
+ {?eh,cth,{'_',id,[[]]}},
+ {?eh,cth,{'_',init,['_',[]]}},
+ {?eh,cth,{'_',post_init_per_suite,[ct_scope_per_suite_cth_SUITE,'$proplist','$proplist',[]]}},
+ {?eh,tc_done,{ct_scope_per_suite_cth_SUITE,init_per_suite,ok}},
+
+ {?eh,tc_start,{ct_scope_per_suite_cth_SUITE,test_case}},
+ {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}},
+ {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}},
+ {?eh,tc_done,{ct_scope_per_suite_cth_SUITE,test_case,ok}},
+
+ {?eh,tc_start,{ct_scope_per_suite_cth_SUITE,end_per_suite}},
+ {?eh,cth,{'_',pre_end_per_suite,
+ [ct_scope_per_suite_cth_SUITE,'$proplist',[]]}},
+ {?eh,cth,{'_',post_end_per_suite,[ct_scope_per_suite_cth_SUITE,'$proplist','_',[]]}},
+ {?eh,cth,{'_',terminate,[[]]}},
+ {?eh,tc_done,{ct_scope_per_suite_cth_SUITE,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(scope_suite_cth) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{ct_scope_suite_cth_SUITE,init_per_suite}},
+ {?eh,cth,{'_',id,[[]]}},
+ {?eh,cth,{'_',init,['_',[]]}},
+ {?eh,cth,{'_',pre_init_per_suite,[ct_scope_suite_cth_SUITE,'$proplist',[]]}},
+ {?eh,cth,{'_',post_init_per_suite,[ct_scope_suite_cth_SUITE,'$proplist','$proplist',[]]}},
+ {?eh,tc_done,{ct_scope_suite_cth_SUITE,init_per_suite,ok}},
+
+ {?eh,tc_start,{ct_scope_suite_cth_SUITE,test_case}},
+ {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}},
+ {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}},
+ {?eh,tc_done,{ct_scope_suite_cth_SUITE,test_case,ok}},
+
+ {?eh,tc_start,{ct_scope_suite_cth_SUITE,end_per_suite}},
+ {?eh,cth,{'_',pre_end_per_suite,[ct_scope_suite_cth_SUITE,'$proplist',[]]}},
+ {?eh,cth,{'_',post_end_per_suite,[ct_scope_suite_cth_SUITE,'$proplist','_',[]]}},
+ {?eh,cth,{'_',terminate,[[]]}},
+ {?eh,tc_done,{ct_scope_suite_cth_SUITE,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(scope_per_group_cth) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{ct_scope_per_group_cth_SUITE,init_per_suite}},
+ {?eh,tc_done,{ct_scope_per_group_cth_SUITE,init_per_suite,ok}},
+
+ [{?eh,tc_start,{ct_scope_per_group_cth_SUITE,{init_per_group,group1,[]}}},
+ {?eh,cth,{'_',id,[[]]}},
+ {?eh,cth,{'_',init,['_',[]]}},
+ {?eh,cth,{'_',post_init_per_group,[group1,'$proplist','$proplist',[]]}},
+ {?eh,tc_done,{ct_scope_per_group_cth_SUITE,{init_per_group,group1,[]},ok}},
+
+ {?eh,tc_start,{ct_scope_per_group_cth_SUITE,test_case}},
+ {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}},
+ {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}},
+ {?eh,tc_done,{ct_scope_per_group_cth_SUITE,test_case,ok}},
+
+ {?eh,tc_start,{ct_scope_per_group_cth_SUITE,{end_per_group,group1,[]}}},
+ {?eh,cth,{'_',pre_end_per_group,[group1,'$proplist',[]]}},
+ {?eh,cth,{'_',post_end_per_group,[group1,'$proplist','_',[]]}},
+ {?eh,cth,{'_',terminate,[[]]}},
+ {?eh,tc_done,{ct_scope_per_group_cth_SUITE,{end_per_group,group1,[]},ok}}],
+
+ {?eh,tc_start,{ct_scope_per_group_cth_SUITE,end_per_suite}},
+ {?eh,tc_done,{ct_scope_per_group_cth_SUITE,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(scope_per_suite_state_cth) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{ct_scope_per_suite_state_cth_SUITE,init_per_suite}},
+ {?eh,cth,{'_',id,[[test]]}},
+ {?eh,cth,{'_',init,['_',[test]]}},
+ {?eh,cth,{'_',post_init_per_suite,[ct_scope_per_suite_state_cth_SUITE,'$proplist','$proplist',[test]]}},
+ {?eh,tc_done,{ct_scope_per_suite_state_cth_SUITE,init_per_suite,ok}},
+
+ {?eh,tc_start,{ct_scope_per_suite_state_cth_SUITE,test_case}},
+ {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[test]]}},
+ {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[test]]}},
+ {?eh,tc_done,{ct_scope_per_suite_state_cth_SUITE,test_case,ok}},
+
+ {?eh,tc_start,{ct_scope_per_suite_state_cth_SUITE,end_per_suite}},
+ {?eh,cth,{'_',pre_end_per_suite,
+ [ct_scope_per_suite_state_cth_SUITE,'$proplist',[test]]}},
+ {?eh,cth,{'_',post_end_per_suite,[ct_scope_per_suite_state_cth_SUITE,'$proplist','_',[test]]}},
+ {?eh,cth,{'_',terminate,[[test]]}},
+ {?eh,tc_done,{ct_scope_per_suite_state_cth_SUITE,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(scope_suite_state_cth) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{ct_scope_suite_state_cth_SUITE,init_per_suite}},
+ {?eh,cth,{'_',id,[[test]]}},
+ {?eh,cth,{'_',init,['_',[test]]}},
+ {?eh,cth,{'_',pre_init_per_suite,[ct_scope_suite_state_cth_SUITE,'$proplist',[test]]}},
+ {?eh,cth,{'_',post_init_per_suite,[ct_scope_suite_state_cth_SUITE,'$proplist','$proplist',[test]]}},
+ {?eh,tc_done,{ct_scope_suite_state_cth_SUITE,init_per_suite,ok}},
+
+ {?eh,tc_start,{ct_scope_suite_state_cth_SUITE,test_case}},
+ {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[test]]}},
+ {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[test]]}},
+ {?eh,tc_done,{ct_scope_suite_state_cth_SUITE,test_case,ok}},
+
+ {?eh,tc_start,{ct_scope_suite_state_cth_SUITE,end_per_suite}},
+ {?eh,cth,{'_',pre_end_per_suite,[ct_scope_suite_state_cth_SUITE,'$proplist',[test]]}},
+ {?eh,cth,{'_',post_end_per_suite,[ct_scope_suite_state_cth_SUITE,'$proplist','_',[test]]}},
+ {?eh,cth,{'_',terminate,[[test]]}},
+ {?eh,tc_done,{ct_scope_suite_state_cth_SUITE,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(scope_per_group_state_cth) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{ct_scope_per_group_state_cth_SUITE,init_per_suite}},
+ {?eh,tc_done,{ct_scope_per_group_state_cth_SUITE,init_per_suite,ok}},
+
+ [{?eh,tc_start,{ct_scope_per_group_state_cth_SUITE,{init_per_group,group1,[]}}},
+ {?eh,cth,{'_',id,[[test]]}},
+ {?eh,cth,{'_',init,['_',[test]]}},
+ {?eh,cth,{'_',post_init_per_group,[group1,'$proplist','$proplist',[test]]}},
+ {?eh,tc_done,{ct_scope_per_group_state_cth_SUITE,{init_per_group,group1,[]},ok}},
+
+ {?eh,tc_start,{ct_scope_per_group_state_cth_SUITE,test_case}},
+ {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[test]]}},
+ {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[test]]}},
+ {?eh,tc_done,{ct_scope_per_group_state_cth_SUITE,test_case,ok}},
+
+ {?eh,tc_start,{ct_scope_per_group_state_cth_SUITE,{end_per_group,group1,[]}}},
+ {?eh,cth,{'_',pre_end_per_group,[group1,'$proplist',[test]]}},
+ {?eh,cth,{'_',post_end_per_group,[group1,'$proplist','_',[test]]}},
+ {?eh,cth,{'_',terminate,[[test]]}},
+ {?eh,tc_done,{ct_scope_per_group_state_cth_SUITE,{end_per_group,group1,[]},ok}}],
+
+ {?eh,tc_start,{ct_scope_per_group_state_cth_SUITE,end_per_suite}},
+ {?eh,tc_done,{ct_scope_per_group_state_cth_SUITE,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(fail_pre_suite_cth) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,cth,{'_',init,['_',[]]}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+
+
+ {?eh,tc_start,{ct_cth_empty_SUITE,init_per_suite}},
+ {?eh,cth,{'_',pre_init_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}},
+ {?eh,cth,{'_',post_init_per_suite,[ct_cth_empty_SUITE,'$proplist',
+ {fail,"Test failure"},[]]}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,init_per_suite,
+ {failed, {error,"Test failure"}}}},
+ {?eh,cth,{'_',on_tc_fail,
+ [init_per_suite,{failed,"Test failure"},[]]}},
+
+
+ {?eh,tc_auto_skip,{ct_cth_empty_SUITE,test_case,
+ {failed,{ct_cth_empty_SUITE,init_per_suite,
+ {failed,"Test failure"}}}}},
+ {?eh,cth,{'_',on_tc_skip,
+ [test_case, {tc_auto_skip,
+ {failed, {ct_cth_empty_SUITE, init_per_suite,
+ {failed, "Test failure"}}}},[]]}},
+
+
+ {?eh,tc_auto_skip, {ct_cth_empty_SUITE, end_per_suite,
+ {failed, {ct_cth_empty_SUITE, init_per_suite,
+ {failed, "Test failure"}}}}},
+ {?eh,cth,{'_',on_tc_skip,
+ [end_per_suite, {tc_auto_skip,
+ {failed, {ct_cth_empty_SUITE, init_per_suite,
+ {failed, "Test failure"}}}},[]]}},
+
+
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,cth, {'_',terminate,[[]]}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(fail_post_suite_cth) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,cth,{'_',init,['_',[]]}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{ct_cth_empty_SUITE,init_per_suite}},
+ {?eh,cth,{'_',pre_init_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}},
+ {?eh,cth,{'_',post_init_per_suite,[ct_cth_empty_SUITE,'$proplist','$proplist',[]]}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,init_per_suite,
+ {failed,{error,"Test failure"}}}},
+ {?eh,cth,{'_',on_tc_fail,[init_per_suite, {failed,"Test failure"}, []]}},
+
+ {?eh,tc_auto_skip,{ct_cth_empty_SUITE,test_case,
+ {failed,{ct_cth_empty_SUITE,init_per_suite,
+ {failed,"Test failure"}}}}},
+ {?eh,cth,{'_',on_tc_skip,[test_case,{tc_auto_skip,'_'},[]]}},
+
+ {?eh,tc_auto_skip, {ct_cth_empty_SUITE, end_per_suite,
+ {failed, {ct_cth_empty_SUITE, init_per_suite,
+ {failed, "Test failure"}}}}},
+ {?eh,cth,{'_',on_tc_skip,[end_per_suite,{tc_auto_skip,'_'},[]]}},
+
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,cth, {'_',terminate,[[]]}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(skip_pre_suite_cth) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,cth,{'_',init,['_',[]]}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{ct_cth_empty_SUITE,init_per_suite}},
+ {?eh,cth,{'_',pre_init_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}},
+ {?eh,cth,{'_',post_init_per_suite,[ct_cth_empty_SUITE,'$proplist',{skip,"Test skip"},[]]}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,init_per_suite,{skipped,"Test skip"}}},
+ {?eh,cth,{'_',on_tc_skip,
+ [init_per_suite,{tc_user_skip,{skipped,"Test skip"}},[]]}},
+
+ {?eh,tc_auto_skip,{ct_cth_empty_SUITE,test_case,"Test skip"}},
+ {?eh,cth,{'_',on_tc_skip,[test_case,{tc_auto_skip,"Test skip"},[]]}},
+
+ {?eh,tc_auto_skip, {ct_cth_empty_SUITE, end_per_suite,"Test skip"}},
+ {?eh,cth,{'_',on_tc_skip,[end_per_suite,{tc_auto_skip,"Test skip"},[]]}},
+
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,cth, {'_',terminate,[[]]}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(skip_post_suite_cth) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,cth,{'_',init,['_',[]]}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+
+ {?eh,tc_start,{ct_cth_empty_SUITE,init_per_suite}},
+ {?eh,cth,{'_',pre_init_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}},
+ {?eh,cth,{'_',post_init_per_suite,[ct_cth_empty_SUITE,'$proplist','$proplist',[]]}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,init_per_suite,{skipped,"Test skip"}}},
+ {?eh,cth,{'_',on_tc_skip,
+ [init_per_suite,{tc_user_skip,{skipped,"Test skip"}},[]]}},
+
+ {?eh,tc_auto_skip,{ct_cth_empty_SUITE,test_case,"Test skip"}},
+ {?eh,cth,{'_',on_tc_skip,[test_case,{tc_auto_skip,"Test skip"},[]]}},
+
+ {?eh,tc_auto_skip, {ct_cth_empty_SUITE, end_per_suite,"Test skip"}},
+ {?eh,cth,{'_',on_tc_skip,[end_per_suite,{tc_auto_skip,"Test skip"},[]]}},
+
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,cth,{'_',terminate,[[]]}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(recover_post_suite_cth) ->
+ Suite = ct_cth_fail_per_suite_SUITE,
+ [
+ {?eh,start_logging,'_'},
+ {?eh,cth,{'_',init,['_',[]]}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{Suite,init_per_suite}},
+ {?eh,cth,{'_',pre_init_per_suite,[Suite,'$proplist','$proplist']}},
+ {?eh,cth,{'_',post_init_per_suite,[Suite,contains([tc_status]),
+ {'EXIT',{'_','_'}},[]]}},
+ {?eh,tc_done,{Suite,init_per_suite,ok}},
+
+ {?eh,tc_start,{Suite,test_case}},
+ {?eh,cth,{'_',pre_init_per_testcase,
+ [test_case, not_contains([tc_status]),[]]}},
+ {?eh,cth,{'_',post_end_per_testcase,
+ [test_case, contains([tc_status]),'_',[]]}},
+ {?eh,tc_done,{Suite,test_case,ok}},
+
+ {?eh,tc_start,{Suite,end_per_suite}},
+ {?eh,cth,{'_',pre_end_per_suite,
+ [Suite,not_contains([tc_status]),[]]}},
+ {?eh,cth,{'_',post_end_per_suite,
+ [Suite,not_contains([tc_status]),'_',[]]}},
+ {?eh,tc_done,{Suite,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,cth,{'_',terminate,[[]]}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(update_config_cth) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,cth,{'_',init,['_',[]]}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+
+ {?eh,tc_start,{ct_update_config_SUITE,init_per_suite}},
+ {?eh,cth,{'_',pre_init_per_suite,
+ [ct_update_config_SUITE,contains([]),[]]}},
+ {?eh,cth,{'_',post_init_per_suite,
+ [ct_update_config_SUITE,
+ '$proplist',
+ contains(
+ [init_per_suite,
+ pre_init_per_suite]),
+ []]}},
+ {?eh,tc_done,{ct_update_config_SUITE,init_per_suite,ok}},
+
+ {?eh,tc_start,{ct_update_config_SUITE, {init_per_group,group1,[]}}},
+ {?eh,cth,{'_',pre_init_per_group,
+ [group1,contains(
+ [post_init_per_suite,
+ init_per_suite,
+ pre_init_per_suite]),
+ []]}},
+ {?eh,cth,{'_',post_init_per_group,
+ [group1,
+ contains(
+ [post_init_per_suite,
+ init_per_suite,
+ pre_init_per_suite]),
+ contains(
+ [init_per_group,
+ pre_init_per_group,
+ post_init_per_suite,
+ init_per_suite,
+ pre_init_per_suite]),
+ []]}},
+ {?eh,tc_done,{ct_update_config_SUITE,{init_per_group,group1,[]},ok}},
+
+ {?eh,tc_start,{ct_update_config_SUITE,test_case}},
+ {?eh,cth,{'_',pre_init_per_testcase,
+ [test_case,contains(
+ [post_init_per_group,
+ init_per_group,
+ pre_init_per_group,
+ post_init_per_suite,
+ init_per_suite,
+ pre_init_per_suite]),
+ []]}},
+ {?eh,cth,{'_',post_end_per_testcase,
+ [test_case,contains(
+ [init_per_testcase,
+ pre_init_per_testcase,
+ post_init_per_group,
+ init_per_group,
+ pre_init_per_group,
+ post_init_per_suite,
+ init_per_suite,
+ pre_init_per_suite]),
+ ok,[]]}},
+ {?eh,tc_done,{ct_update_config_SUITE,test_case,ok}},
+
+ {?eh,tc_start,{ct_update_config_SUITE, {end_per_group,group1,[]}}},
+ {?eh,cth,{'_',pre_end_per_group,
+ [group1,contains(
+ [post_init_per_group,
+ init_per_group,
+ pre_init_per_group,
+ post_init_per_suite,
+ init_per_suite,
+ pre_init_per_suite]),
+ []]}},
+ {?eh,cth,{'_',post_end_per_group,
+ [group1,
+ contains(
+ [pre_end_per_group,
+ post_init_per_group,
+ init_per_group,
+ pre_init_per_group,
+ post_init_per_suite,
+ init_per_suite,
+ pre_init_per_suite]),
+ ok,[]]}},
+ {?eh,tc_done,{ct_update_config_SUITE,{end_per_group,group1,[]},ok}},
+
+ {?eh,tc_start,{ct_update_config_SUITE,end_per_suite}},
+ {?eh,cth,{'_',pre_end_per_suite,
+ [ct_update_config_SUITE,contains(
+ [post_init_per_suite,
+ init_per_suite,
+ pre_init_per_suite]),
+ []]}},
+ {?eh,cth,{'_',post_end_per_suite,
+ [ct_update_config_SUITE,contains(
+ [pre_end_per_suite,
+ post_init_per_suite,
+ init_per_suite,
+ pre_init_per_suite]),
+ '_',[]]}},
+ {?eh,tc_done,{ct_update_config_SUITE,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,cth,{'_',terminate,[contains(
+ [post_end_per_suite,
+ pre_end_per_suite,
+ post_init_per_suite,
+ init_per_suite,
+ pre_init_per_suite])]}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(state_update_cth) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,cth,{'_',init,['_',[]]}},
+ {?eh,cth,{'_',init,['_',[]]}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{'_',init_per_suite}},
+
+ {?eh,tc_done,{'_',end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,cth,{'_',terminate,[contains(
+ [post_end_per_suite,pre_end_per_suite,
+ post_end_per_group,pre_end_per_group,
+ {not_in_order,
+ [post_end_per_testcase,pre_init_per_testcase,
+ on_tc_skip,post_end_per_testcase,
+ pre_init_per_testcase,on_tc_fail,
+ post_end_per_testcase,pre_init_per_testcase]
+ },
+ post_init_per_group,pre_init_per_group,
+ post_init_per_suite,pre_init_per_suite,
+ init])]}},
+ {?eh,cth,{'_',terminate,[contains(
+ [post_end_per_suite,pre_end_per_suite,
+ post_end_per_group,pre_end_per_group,
+ {not_in_order,
+ [post_end_per_testcase,pre_init_per_testcase,
+ on_tc_skip,post_end_per_testcase,
+ pre_init_per_testcase,on_tc_fail,
+ post_end_per_testcase,pre_init_per_testcase]
+ },
+ post_init_per_group,pre_init_per_group,
+ post_init_per_suite,pre_init_per_suite,
+ init]
+ )]}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(options_cth) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,cth,{empty_cth,init,['_',[test]]}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{ct_cth_empty_SUITE,init_per_suite}},
+ {?eh,cth,{empty_cth,pre_init_per_suite,
+ [ct_cth_empty_SUITE,'$proplist',[test]]}},
+ {?eh,cth,{empty_cth,post_init_per_suite,
+ [ct_cth_empty_SUITE,'$proplist','$proplist',[test]]}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,init_per_suite,ok}},
+
+ {?eh,tc_start,{ct_cth_empty_SUITE,test_case}},
+ {?eh,cth,{empty_cth,pre_init_per_testcase,[test_case,'$proplist',[test]]}},
+ {?eh,cth,{empty_cth,post_end_per_testcase,[test_case,'$proplist','_',[test]]}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,test_case,ok}},
+
+ {?eh,tc_start,{ct_cth_empty_SUITE,end_per_suite}},
+ {?eh,cth,{empty_cth,pre_end_per_suite,
+ [ct_cth_empty_SUITE,'$proplist',[test]]}},
+ {?eh,cth,{empty_cth,post_end_per_suite,[ct_cth_empty_SUITE,'$proplist','_',[test]]}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,cth,{empty_cth,terminate,[[test]]}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(same_id_cth) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,cth,{'_',id,[[]]}},
+ {?eh,cth,{'_',init,[same_id_cth,[]]}},
+ {?eh,cth,{'_',id,[[]]}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{ct_cth_empty_SUITE,init_per_suite}},
+ {?eh,cth,{'_',pre_init_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}},
+ {negative,
+ {?eh,cth,{'_',pre_init_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}},
+ {?eh,cth,{'_',post_init_per_suite,
+ [ct_cth_empty_SUITE,'$proplist','$proplist',[]]}}},
+ {negative,
+ {?eh,cth,{'_',post_init_per_suite,
+ [ct_cth_empty_SUITE,'$proplist','$proplist',[]]}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,init_per_suite,ok}}},
+
+ {?eh,tc_start,{ct_cth_empty_SUITE,test_case}},
+ {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}},
+ {negative,
+ {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}},
+ {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}},
+ {negative,
+ {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,test_case,ok}}},
+
+ {?eh,tc_start,{ct_cth_empty_SUITE,end_per_suite}},
+ {?eh,cth,{'_',pre_end_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}},
+ {negative,
+ {?eh,cth,{'_',pre_end_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}},
+ {?eh,cth,{'_',post_end_per_suite,[ct_cth_empty_SUITE,'$proplist','_',[]]}}},
+ {negative,
+ {?eh,cth,{'_',post_end_per_suite,
+ [ct_cth_empty_SUITE,'$proplist','_',[]]}},
+ {?eh,tc_done,{ct_cth_empty_SUITE,end_per_suite,ok}}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,cth,{'_',terminate,[[]]}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(fail_n_skip_with_minimal_cth) ->
+ [{?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,cth,{'_',init,['_',[]]}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{'_',init_per_suite}},
+
+ {?eh,tc_done,{'_',end_per_suite,ok}},
+ {?eh,cth,{'_',terminate,[[]]}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(ok) ->
+ ok.
+
+
+%% test events help functions
+contains(List) ->
+ fun(Proplist) when is_list(Proplist) ->
+ contains(List,Proplist)
+ end.
+
+contains([{not_in_order,List}|T],Rest) ->
+ contains_parallel(List,Rest),
+ contains(T,Rest);
+contains([{Ele,Pos}|T] = L,[H|T2]) ->
+ case element(Pos,H) of
+ Ele ->
+ contains(T,T2);
+ _ ->
+ contains(L,T2)
+ end;
+contains([Ele|T],[{Ele,_}|T2])->
+ contains(T,T2);
+contains([Ele|T],[Ele|T2])->
+ contains(T,T2);
+contains(List,[_|T]) ->
+ contains(List,T);
+contains([],_) ->
+ match.
+
+contains_parallel([Key | T], Elems) ->
+ contains([Key],Elems),
+ contains_parallel(T,Elems);
+contains_parallel([],_Elems) ->
+ match.
+
+not_contains(List) ->
+ fun(Proplist) when is_list(Proplist) ->
+ [] = [Ele || {Ele,_} <- Proplist,
+ Test <- List,
+ Test =:= Ele]
+ end.
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_id_scb.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_id_cth.erl
index 2c256c46df..02c36e378c 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_id_scb.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_id_cth.erl
@@ -18,17 +18,17 @@
%%
--module(crash_id_scb).
+-module(crash_id_cth).
-include_lib("common_test/src/ct_util.hrl").
-include_lib("common_test/include/ct_event.hrl").
-%% Suite Callbacks
+%% CT Hooks
-export([id/1]).
id(Opts) ->
- empty_scb:id(Opts),
+ empty_cth:id(Opts),
exit(diediedie).
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_init_scb.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_init_cth.erl
index c4138bbcef..6ed23565f6 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_init_scb.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_init_cth.erl
@@ -18,17 +18,17 @@
%%
--module(crash_init_scb).
+-module(crash_init_cth).
-include_lib("common_test/src/ct_util.hrl").
-include_lib("common_test/include/ct_event.hrl").
-%% Suite Callbacks
+%% CT Hooks
-export([init/2]).
init(Id, Opts) ->
- empty_scb:init(Id, Opts),
+ empty_cth:init(Id, Opts),
exit(diediedie).
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_empty_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_empty_SUITE.erl
index 0eb40bce00..499069b382 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_empty_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_empty_SUITE.erl
@@ -17,7 +17,7 @@
%% %CopyrightEnd%
%%
--module(ct_scb_empty_SUITE).
+-module(ct_cth_empty_SUITE).
-suite_defaults([{timetrap, {minutes, 10}}]).
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_one_skip_one_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_one_skip_one_SUITE.erl
index 593bd4a534..017812c719 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_one_skip_one_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_one_skip_one_SUITE.erl
@@ -17,7 +17,7 @@
%% %CopyrightEnd%
%%
--module(ct_scb_fail_one_skip_one_SUITE).
+-module(ct_cth_fail_one_skip_one_SUITE).
-suite_defaults([{timetrap, {minutes, 10}}]).
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_per_suite_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_per_suite_SUITE.erl
index dfc7c37e8d..136a15ec96 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_per_suite_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_per_suite_SUITE.erl
@@ -17,7 +17,7 @@
%% %CopyrightEnd%
%%
--module(ct_scb_fail_per_suite_SUITE).
+-module(ct_cth_fail_per_suite_SUITE).
-suite_defaults([{timetrap, {minutes, 10}}]).
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_exit_in_init_scope_suite_scb_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_exit_in_init_scope_suite_cth_SUITE.erl
index bfaeb7ca3a..42be0a659e 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_exit_in_init_scope_suite_scb_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_exit_in_init_scope_suite_cth_SUITE.erl
@@ -17,7 +17,7 @@
%% %CopyrightEnd%
%%
--module(ct_exit_in_init_scope_suite_scb_SUITE).
+-module(ct_exit_in_init_scope_suite_cth_SUITE).
-suite_defaults([{timetrap, {minutes, 10}}]).
@@ -28,7 +28,7 @@
%% Test server callback functions
suite() ->
- [{suite_callbacks,[crash_init_scb]}].
+ [{ct_hooks,[crash_init_cth]}].
init_per_suite(Config) ->
Config.
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_scb_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_group_cth_SUITE.erl
index 8df4a6d522..628bca774c 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_scb_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_group_cth_SUITE.erl
@@ -17,7 +17,7 @@
%% %CopyrightEnd%
%%
--module(ct_scope_per_group_scb_SUITE).
+-module(ct_scope_per_group_cth_SUITE).
-suite_defaults([{timetrap, {minutes, 10}}]).
@@ -40,7 +40,7 @@ end_per_testcase(_TestCase, _Config) ->
ok.
init_per_group(GroupName, Config) ->
- [{suite_callbacks,[empty_scb]}|Config].
+ [{ct_hooks,[empty_cth]}|Config].
end_per_group(GroupName, Config) ->
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_hooks_SUITE_data/cth/tests/ct_scope_per_group_state_cth_SUITE.erl
index 63dd767b25..14ea52bf8c 100644
--- 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_hooks_SUITE_data/cth/tests/ct_scope_per_group_state_cth_SUITE.erl
@@ -17,7 +17,7 @@
%% %CopyrightEnd%
%%
--module(ct_scope_per_group_state_scb_SUITE).
+-module(ct_scope_per_group_state_cth_SUITE).
-suite_defaults([{timetrap, {minutes, 10}}]).
@@ -40,7 +40,7 @@ end_per_testcase(_TestCase, _Config) ->
ok.
init_per_group(_GroupName, Config) ->
- [{suite_callbacks,[{empty_scb,[test]}]}|Config].
+ [{ct_hooks,[{empty_cth,[test]}]}|Config].
end_per_group(_GroupName, _Config) ->
ok.
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_scb_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_suite_cth_SUITE.erl
index 5492243b1b..5c1658be44 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_scb_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_suite_cth_SUITE.erl
@@ -17,7 +17,7 @@
%% %CopyrightEnd%
%%
--module(ct_scope_per_suite_scb_SUITE).
+-module(ct_scope_per_suite_cth_SUITE).
-suite_defaults([{timetrap, {minutes, 10}}]).
@@ -28,7 +28,7 @@
%% Test server callback functions
init_per_suite(Config) ->
- [{suite_callbacks,[empty_scb]}|Config].
+ [{ct_hooks,[empty_cth]}|Config].
end_per_suite(_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_hooks_SUITE_data/cth/tests/ct_scope_per_suite_state_cth_SUITE.erl
index 02a011f91b..96d00e3b28 100644
--- 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_hooks_SUITE_data/cth/tests/ct_scope_per_suite_state_cth_SUITE.erl
@@ -17,7 +17,7 @@
%% %CopyrightEnd%
%%
--module(ct_scope_per_suite_state_scb_SUITE).
+-module(ct_scope_per_suite_state_cth_SUITE).
-suite_defaults([{timetrap, {minutes, 10}}]).
@@ -28,7 +28,7 @@
%% Test server callback functions
init_per_suite(Config) ->
- [{suite_callbacks,[{empty_scb,[test]}]}|Config].
+ [{ct_hooks,[{empty_cth,[test]}]}|Config].
end_per_suite(_Config) ->
ok.
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_tc_scb_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_tc_cth_SUITE.erl
index d99e741553..fa632444c5 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_tc_scb_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_tc_cth_SUITE.erl
@@ -17,7 +17,7 @@
%% %CopyrightEnd%
%%
--module(ct_scope_per_tc_scb_SUITE).
+-module(ct_scope_per_tc_cth_SUITE).
-suite_defaults([{timetrap, {minutes, 10}}]).
@@ -73,7 +73,7 @@ end_per_suite(_Config) ->
%% @end
%%--------------------------------------------------------------------
init_per_testcase(_TestCase, Config) ->
- [{suite_callbacks,[empty_scb]}|Config].
+ [{ct_hooks,[empty_cth]}|Config].
%%--------------------------------------------------------------------
%% @doc
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_scb_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_cth_SUITE.erl
index 7598c911b1..988a0969ca 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_scb_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_cth_SUITE.erl
@@ -17,7 +17,7 @@
%% %CopyrightEnd%
%%
--module(ct_scope_suite_scb_SUITE).
+-module(ct_scope_suite_cth_SUITE).
-suite_defaults([{timetrap, {minutes, 10}}]).
@@ -28,7 +28,7 @@
%% Test server callback functions
suite() ->
- [{suite_callbacks,[empty_scb]}].
+ [{ct_hooks,[empty_cth]}].
init_per_suite(Config) ->
Config.
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_hooks_SUITE_data/cth/tests/ct_scope_suite_state_cth_SUITE.erl
index 869532f5cd..18b68fbcdc 100644
--- 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_hooks_SUITE_data/cth/tests/ct_scope_suite_state_cth_SUITE.erl
@@ -17,7 +17,7 @@
%% %CopyrightEnd%
%%
--module(ct_scope_suite_state_scb_SUITE).
+-module(ct_scope_suite_state_cth_SUITE).
-suite_defaults([{timetrap, {minutes, 10}}]).
@@ -28,7 +28,7 @@
%% Test server callback functions
suite() ->
- [{suite_callbacks,[{empty_scb,[test]}]}].
+ [{ct_hooks,[{empty_cth,[test]}]}].
init_per_suite(Config) ->
Config.
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_update_config_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_update_config_SUITE.erl
index 57fea347f6..57fea347f6 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_update_config_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_update_config_SUITE.erl
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl
index a82ca02d04..7654a7ee2f 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl
@@ -19,22 +19,22 @@
%%% @doc Common Test Example Suite Callback module.
%%%
-%%% <p>This module gives an example of a common test SCB (Suite CallBack).
-%%% There are many ways to add a SCB to a test run, you can do it either in
-%%% the command line using -suite_callback, in a test spec using
-%%% {suite_callback,M} or in the suite it self by returning suite_callback
+%%% <p>This module gives an example of a common test CTH (Common Test Hook).
+%%% There are many ways to add a CTH to a test run, you can do it either in
+%%% the command line using -ct_hook, in a test spec using
+%%% {ct_hook,M} or in the suite it self by returning ct_hook
%%% from either suite/0, init_per_suite/1, init_per_group/2 and
-%%% init_per_testcase/2. The scope of the SCB is determined by where is it
+%%% init_per_testcase/2. The scope of the CTH is determined by where is it
%%% started. If it is started in the command line or test spec then it will
%%% be stopped at the end of all tests. If it is started in init_per_suite,
%%% it will be stopped after end_per_suite and so on. See terminate
%%% documentation for a table describing the scoping machanics.
%%%
-%%% All of callbacks except init/1 in a SCB are optional.</p>
+%%% All of callbacks except init/1 in a CTH are optional.</p>
--module(empty_scb).
+-module(empty_cth).
-%% Suite Callbacks
+%% CT Hooks
-export([id/1]).
-export([init/2]).
@@ -69,26 +69,26 @@
-record(state, { id = ?MODULE :: term()}).
%% @doc Always called before any other callback function. Use this to initiate
-%% any common state. It should return an ID for this SCB and a state.
+%% any common state. It should return an state for this CTH.
-spec init(Id :: term(), Opts :: proplist()) ->
{Id :: term(), State :: #state{}}.
init(Id, Opts) ->
- gen_event:notify(?CT_EVMGR_REF, #event{ name = scb, node = node(),
+ gen_event:notify(?CT_EVMGR_REF, #event{ name = cth, node = node(),
data = {?MODULE, init, [Id, Opts]}}),
Opts.
-%% @doc The ID is used to uniquly identify an SCB instance, if two SCB's
-%% return the same ID the seconds SCB is ignored. This function should NOT
+%% @doc The ID is used to uniquly identify an CTH instance, if two CTH's
+%% return the same ID the seconds CTH is ignored. This function should NOT
%% have any side effects as it might be called multiple times by common test.
-spec id(Opts :: proplist()) ->
Id :: term().
id(Opts) ->
- gen_event:notify(?CT_EVMGR_REF, #event{ name = scb, node = node(),
+ gen_event:notify(?CT_EVMGR_REF, #event{ name = cth, node = node(),
data = {?MODULE, id, [Opts]}}),
now().
%% @doc Called before init_per_suite is called. Note that this callback is
-%% only called if the SCB is added before init_per_suite is run (eg. in a test
+%% only called if the CTH is added before init_per_suite is run (eg. in a test
%% specification, suite/0 function etc).
%% You can change the config in the this function.
-spec pre_init_per_suite(Suite :: atom(),
@@ -97,7 +97,7 @@ id(Opts) ->
{config() | skip_or_fail(), NewState :: #state{}}.
pre_init_per_suite(Suite,Config,State) ->
gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = scb, node = node(),
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
data = {?MODULE, pre_init_per_suite,
[Suite,Config,State]}}),
{Config, State}.
@@ -111,7 +111,7 @@ pre_init_per_suite(Suite,Config,State) ->
{config() | skip_or_fail(), NewState :: #state{}}.
post_init_per_suite(Suite,Config,Return,State) ->
gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = scb, node = node(),
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
data = {?MODULE, post_init_per_suite,
[Suite,Config,Return,State]}}),
{Return, State}.
@@ -124,7 +124,7 @@ post_init_per_suite(Suite,Config,Return,State) ->
{ok | skip_or_fail(), NewState :: #state{}}.
pre_end_per_suite(Suite,Config,State) ->
gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = scb, node = node(),
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
data = {?MODULE, pre_end_per_suite,
[Suite,Config,State]}}),
{Config, State}.
@@ -138,7 +138,7 @@ pre_end_per_suite(Suite,Config,State) ->
{ok | skip_or_fail(), NewState :: #state{}}.
post_end_per_suite(Suite,Config,Return,State) ->
gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = scb, node = node(),
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
data = {?MODULE, post_end_per_suite,
[Suite,Config,Return,State]}}),
{Return, State}.
@@ -151,7 +151,7 @@ post_end_per_suite(Suite,Config,Return,State) ->
{config() | skip_or_fail(), NewState :: #state{}}.
pre_init_per_group(Group,Config,State) ->
gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = scb, node = node(),
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
data = {?MODULE, pre_init_per_group,
[Group,Config,State]}}),
{Config, State}.
@@ -165,7 +165,7 @@ pre_init_per_group(Group,Config,State) ->
{config() | skip_or_fail(), NewState :: #state{}}.
post_init_per_group(Group,Config,Return,State) ->
gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = scb, node = node(),
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
data = {?MODULE, post_init_per_group,
[Group,Config,Return,State]}}),
{Return, State}.
@@ -178,7 +178,7 @@ post_init_per_group(Group,Config,Return,State) ->
{ok | skip_or_fail(), NewState :: #state{}}.
pre_end_per_group(Group,Config,State) ->
gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = scb, node = node(),
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
data = {?MODULE, pre_end_per_group,
[Group,Config,State]}}),
{Config, State}.
@@ -192,7 +192,7 @@ pre_end_per_group(Group,Config,State) ->
{ok | skip_or_fail(), NewState :: #state{}}.
post_end_per_group(Group,Config,Return,State) ->
gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = scb, node = node(),
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
data = {?MODULE, post_end_per_group,
[Group,Config,Return,State]}}),
{Return, State}.
@@ -205,7 +205,7 @@ post_end_per_group(Group,Config,Return,State) ->
{config() | skip_or_fail(), NewState :: #state{}}.
pre_init_per_testcase(TC,Config,State) ->
gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = scb, node = node(),
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
data = {?MODULE, pre_init_per_testcase,
[TC,Config,State]}}),
{Config, State}.
@@ -219,7 +219,7 @@ pre_init_per_testcase(TC,Config,State) ->
{ok | skip_or_fail(), NewState :: #state{}}.
post_end_per_testcase(TC,Config,Return,State) ->
gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = scb, node = node(),
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
data = {?MODULE, post_end_per_testcase,
[TC,Config,Return,State]}}),
{Return, State}.
@@ -234,7 +234,7 @@ post_end_per_testcase(TC,Config,Return,State) ->
NewState :: #state{}.
on_tc_fail(TC, Reason, State) ->
gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = scb, node = node(),
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
data = {?MODULE, on_tc_fail,
[TC,Reason,State]}}),
State.
@@ -250,13 +250,13 @@ on_tc_fail(TC, Reason, State) ->
NewState :: #state{}.
on_tc_skip(TC, Reason, State) ->
gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = scb, node = node(),
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
data = {?MODULE, on_tc_skip,
[TC,Reason,State]}}),
State.
-%% @doc Called when the scope of the SCB is done, this depends on
-%% when the SCB was specified. This translation table describes when this
+%% @doc Called when the scope of the CTH is done, this depends on
+%% when the CTH was specified. This translation table describes when this
%% function is called.
%%
%% | Started in | terminate called |
@@ -272,6 +272,6 @@ on_tc_skip(TC, Reason, State) ->
term().
terminate(State) ->
gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = scb, node = node(),
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
data = {?MODULE, terminate, [State]}}),
ok.
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_pre_suite_scb.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_post_suite_cth.erl
index 90f10d7531..b4c26259a6 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_pre_suite_scb.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_post_suite_cth.erl
@@ -18,55 +18,55 @@
%%
--module(fail_pre_suite_scb).
+-module(fail_post_suite_cth).
-include_lib("common_test/src/ct_util.hrl").
-include_lib("common_test/include/ct_event.hrl").
-%% Suite Callbacks
+%% CT Hooks
-compile(export_all).
init(Id, Opts) ->
- empty_scb:init(Id, Opts).
+ empty_cth:init(Id, Opts).
pre_init_per_suite(Suite, Config, State) ->
- empty_scb:pre_init_per_suite(Suite,Config,State),
- {{fail, "Test failure"}, State}.
+ empty_cth:pre_init_per_suite(Suite,Config,State).
post_init_per_suite(Suite,Config,Return,State) ->
- empty_scb:post_init_per_suite(Suite,Config,Return,State).
+ empty_cth:post_init_per_suite(Suite,Config,Return,State),
+ {{fail, "Test failure"}, State}.
pre_end_per_suite(Suite,Config,State) ->
- empty_scb:pre_end_per_suite(Suite,Config,State).
+ empty_cth:pre_end_per_suite(Suite,Config,State).
post_end_per_suite(Suite,Config,Return,State) ->
- empty_scb:post_end_per_suite(Suite,Config,Return,State).
+ empty_cth:post_end_per_suite(Suite,Config,Return,State).
pre_init_per_group(Group,Config,State) ->
- empty_scb:pre_init_per_group(Group,Config,State).
+ empty_cth:pre_init_per_group(Group,Config,State).
post_init_per_group(Group,Config,Return,State) ->
- empty_scb:post_init_per_group(Group,Config,Return,State).
+ empty_cth:post_init_per_group(Group,Config,Return,State).
pre_end_per_group(Group,Config,State) ->
- empty_scb:pre_end_per_group(Group,Config,State).
+ empty_cth:pre_end_per_group(Group,Config,State).
post_end_per_group(Group,Config,Return,State) ->
- empty_scb:post_end_per_group(Group,Config,Return,State).
+ empty_cth:post_end_per_group(Group,Config,Return,State).
pre_init_per_testcase(TC,Config,State) ->
- empty_scb:pre_init_per_testcase(TC,Config,State).
+ empty_cth:pre_init_per_testcase(TC,Config,State).
post_end_per_testcase(TC,Config,Return,State) ->
- empty_scb:post_end_per_testcase(TC,Config,Return,State).
+ empty_cth:post_end_per_testcase(TC,Config,Return,State).
on_tc_fail(TC, Reason, State) ->
- empty_scb:on_tc_fail(TC,Reason,State).
+ empty_cth:on_tc_fail(TC,Reason,State).
on_tc_skip(TC, Reason, State) ->
- empty_scb:on_tc_skip(TC,Reason,State).
+ empty_cth:on_tc_skip(TC,Reason,State).
terminate(State) ->
- empty_scb:terminate(State).
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_post_suite_scb.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_pre_suite_cth.erl
index 44c72f6795..acf80a1b2e 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_post_suite_scb.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_pre_suite_cth.erl
@@ -18,55 +18,55 @@
%%
--module(fail_post_suite_scb).
+-module(fail_pre_suite_cth).
-include_lib("common_test/src/ct_util.hrl").
-include_lib("common_test/include/ct_event.hrl").
-%% Suite Callbacks
+%% CT Hooks
-compile(export_all).
init(Id, Opts) ->
- empty_scb:init(Id, Opts).
+ empty_cth:init(Id, Opts).
pre_init_per_suite(Suite, Config, State) ->
- empty_scb:pre_init_per_suite(Suite,Config,State).
+ empty_cth:pre_init_per_suite(Suite,Config,State),
+ {{fail, "Test failure"}, State}.
post_init_per_suite(Suite,Config,Return,State) ->
- empty_scb:post_init_per_suite(Suite,Config,Return,State),
- {{fail, "Test failure"}, State}.
+ empty_cth:post_init_per_suite(Suite,Config,Return,State).
pre_end_per_suite(Suite,Config,State) ->
- empty_scb:pre_end_per_suite(Suite,Config,State).
+ empty_cth:pre_end_per_suite(Suite,Config,State).
post_end_per_suite(Suite,Config,Return,State) ->
- empty_scb:post_end_per_suite(Suite,Config,Return,State).
+ empty_cth:post_end_per_suite(Suite,Config,Return,State).
pre_init_per_group(Group,Config,State) ->
- empty_scb:pre_init_per_group(Group,Config,State).
+ empty_cth:pre_init_per_group(Group,Config,State).
post_init_per_group(Group,Config,Return,State) ->
- empty_scb:post_init_per_group(Group,Config,Return,State).
+ empty_cth:post_init_per_group(Group,Config,Return,State).
pre_end_per_group(Group,Config,State) ->
- empty_scb:pre_end_per_group(Group,Config,State).
+ empty_cth:pre_end_per_group(Group,Config,State).
post_end_per_group(Group,Config,Return,State) ->
- empty_scb:post_end_per_group(Group,Config,Return,State).
+ empty_cth:post_end_per_group(Group,Config,Return,State).
pre_init_per_testcase(TC,Config,State) ->
- empty_scb:pre_init_per_testcase(TC,Config,State).
+ empty_cth:pre_init_per_testcase(TC,Config,State).
post_end_per_testcase(TC,Config,Return,State) ->
- empty_scb:post_end_per_testcase(TC,Config,Return,State).
+ empty_cth:post_end_per_testcase(TC,Config,Return,State).
on_tc_fail(TC, Reason, State) ->
- empty_scb:on_tc_fail(TC,Reason,State).
+ empty_cth:on_tc_fail(TC,Reason,State).
on_tc_skip(TC, Reason, State) ->
- empty_scb:on_tc_skip(TC,Reason,State).
+ empty_cth:on_tc_skip(TC,Reason,State).
terminate(State) ->
- empty_scb:terminate(State).
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/id_no_init_scb.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/id_no_init_cth.erl
index 11fb8d739f..58ed400e1c 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/id_no_init_scb.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/id_no_init_cth.erl
@@ -18,15 +18,15 @@
%%
--module(id_no_init_scb).
+-module(id_no_init_cth).
-include_lib("common_test/src/ct_util.hrl").
-include_lib("common_test/include/ct_event.hrl").
-%% Suite Callbacks
+%% CT Hooks
-export([id/1]).
id(Opts) ->
- empty_scb:id(Opts).
+ empty_cth:id(Opts).
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_scb.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_cth.erl
index b3feb1383c..a18f4bf2f3 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_scb.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_cth.erl
@@ -18,16 +18,16 @@
%%
--module(minimal_scb).
+-module(minimal_cth).
-include_lib("common_test/src/ct_util.hrl").
-include_lib("common_test/include/ct_event.hrl").
-%% Suite Callbacks
+%% CT Hooks
-export([init/2]).
init(Id, Opts) ->
- empty_scb:init(Id, Opts).
+ empty_cth:init(Id, Opts).
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_terminate_scb.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_terminate_cth.erl
index 3f76d2f47d..79cd55f68e 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_terminate_scb.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_terminate_cth.erl
@@ -18,21 +18,21 @@
%%
--module(minimal_terminate_scb).
+-module(minimal_terminate_cth).
-include_lib("common_test/src/ct_util.hrl").
-include_lib("common_test/include/ct_event.hrl").
-%% Suite Callbacks
+%% CT Hooks
-export([init/2]).
-export([terminate/1]).
init(Id, Opts) ->
- empty_scb:init(Id, Opts).
+ empty_cth:init(Id, Opts).
terminate(State) ->
- empty_scb:terminate(State).
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/recover_post_suite_scb.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/recover_post_suite_cth.erl
index 26468f0789..01a932bd59 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/recover_post_suite_scb.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/recover_post_suite_cth.erl
@@ -18,57 +18,57 @@
%%
--module(recover_post_suite_scb).
+-module(recover_post_suite_cth).
-include_lib("common_test/src/ct_util.hrl").
-include_lib("common_test/include/ct_event.hrl").
-%% Suite Callbacks
+%% CT Hooks
-compile(export_all).
init(Id, Opts) ->
- empty_scb:init(Id, Opts).
+ empty_cth:init(Id, Opts).
pre_init_per_suite(Suite, Config, State) ->
- empty_scb:pre_init_per_suite(Suite,Config,State).
+ empty_cth:pre_init_per_suite(Suite,Config,State).
post_init_per_suite(Suite,Config,{'EXIT',Reason} = Return,State) ->
- empty_scb:post_init_per_suite(Suite,Config,Return,State),
+ empty_cth:post_init_per_suite(Suite,Config,Return,State),
{lists:keydelete(tc_status,1,Config),State};
post_init_per_suite(Suite,Config,Return,State) ->
- empty_scb:post_init_per_suite(Suite,Config,Return,State).
+ empty_cth:post_init_per_suite(Suite,Config,Return,State).
pre_end_per_suite(Suite,Config,State) ->
- empty_scb:pre_end_per_suite(Suite,Config,State).
+ empty_cth:pre_end_per_suite(Suite,Config,State).
post_end_per_suite(Suite,Config,Return,State) ->
- empty_scb:post_end_per_suite(Suite,Config,Return,State).
+ empty_cth:post_end_per_suite(Suite,Config,Return,State).
pre_init_per_group(Group,Config,State) ->
- empty_scb:pre_init_per_group(Group,Config,State).
+ empty_cth:pre_init_per_group(Group,Config,State).
post_init_per_group(Group,Config,Return,State) ->
- empty_scb:post_init_per_group(Group,Config,Return,State).
+ empty_cth:post_init_per_group(Group,Config,Return,State).
pre_end_per_group(Group,Config,State) ->
- empty_scb:pre_end_per_group(Group,Config,State).
+ empty_cth:pre_end_per_group(Group,Config,State).
post_end_per_group(Group,Config,Return,State) ->
- empty_scb:post_end_per_group(Group,Config,Return,State).
+ empty_cth:post_end_per_group(Group,Config,Return,State).
pre_init_per_testcase(TC,Config,State) ->
- empty_scb:pre_init_per_testcase(TC,Config,State).
+ empty_cth:pre_init_per_testcase(TC,Config,State).
post_end_per_testcase(TC,Config,Return,State) ->
- empty_scb:post_end_per_testcase(TC,Config,Return,State).
+ empty_cth:post_end_per_testcase(TC,Config,Return,State).
on_tc_fail(TC, Reason, State) ->
- empty_scb:on_tc_fail(TC,Reason,State).
+ empty_cth:on_tc_fail(TC,Reason,State).
on_tc_skip(TC, Reason, State) ->
- empty_scb:on_tc_skip(TC,Reason,State).
+ empty_cth:on_tc_skip(TC,Reason,State).
terminate(State) ->
- empty_scb:terminate(State).
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/same_id_scb.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/same_id_cth.erl
index 0fa708d5b6..acfb93fe26 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/same_id_scb.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/same_id_cth.erl
@@ -18,58 +18,58 @@
%%
--module(same_id_scb).
+-module(same_id_cth).
-include_lib("common_test/src/ct_util.hrl").
-include_lib("common_test/include/ct_event.hrl").
-%% Suite Callbacks
+%% CT Hooks
-compile(export_all).
id(Opts) ->
- empty_scb:id(Opts),
+ empty_cth:id(Opts),
?MODULE.
init(Id, Opts) ->
- empty_scb:init(Id, Opts).
+ empty_cth:init(Id, Opts).
pre_init_per_suite(Suite, Config, State) ->
- empty_scb:pre_init_per_suite(Suite,Config,State).
+ empty_cth:pre_init_per_suite(Suite,Config,State).
post_init_per_suite(Suite,Config,Return,State) ->
- empty_scb:post_init_per_suite(Suite,Config,Return,State).
+ empty_cth:post_init_per_suite(Suite,Config,Return,State).
pre_end_per_suite(Suite,Config,State) ->
- empty_scb:pre_end_per_suite(Suite,Config,State).
+ empty_cth:pre_end_per_suite(Suite,Config,State).
post_end_per_suite(Suite,Config,Return,State) ->
- empty_scb:post_end_per_suite(Suite,Config,Return,State).
+ empty_cth:post_end_per_suite(Suite,Config,Return,State).
pre_init_per_group(Group,Config,State) ->
- empty_scb:pre_init_per_group(Group,Config,State).
+ empty_cth:pre_init_per_group(Group,Config,State).
post_init_per_group(Group,Config,Return,State) ->
- empty_scb:post_init_per_group(Group,Config,Return,State).
+ empty_cth:post_init_per_group(Group,Config,Return,State).
pre_end_per_group(Group,Config,State) ->
- empty_scb:pre_end_per_group(Group,Config,State).
+ empty_cth:pre_end_per_group(Group,Config,State).
post_end_per_group(Group,Config,Return,State) ->
- empty_scb:post_end_per_group(Group,Config,Return,State).
+ empty_cth:post_end_per_group(Group,Config,Return,State).
pre_init_per_testcase(TC,Config,State) ->
- empty_scb:pre_init_per_testcase(TC,Config,State).
+ empty_cth:pre_init_per_testcase(TC,Config,State).
post_end_per_testcase(TC,Config,Return,State) ->
- empty_scb:post_end_per_testcase(TC,Config,Return,State).
+ empty_cth:post_end_per_testcase(TC,Config,Return,State).
on_tc_fail(TC, Reason, State) ->
- empty_scb:on_tc_fail(TC,Reason,State).
+ empty_cth:on_tc_fail(TC,Reason,State).
on_tc_skip(TC, Reason, State) ->
- empty_scb:on_tc_skip(TC,Reason,State).
+ empty_cth:on_tc_skip(TC,Reason,State).
terminate(State) ->
- empty_scb:terminate(State).
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_post_suite_scb.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_post_suite_cth.erl
index bb93ebee0f..6d4605b33b 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_post_suite_scb.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_post_suite_cth.erl
@@ -18,55 +18,55 @@
%%
--module(skip_post_suite_scb).
+-module(skip_post_suite_cth).
-include_lib("common_test/src/ct_util.hrl").
-include_lib("common_test/include/ct_event.hrl").
-%% Suite Callbacks
+%% CT Hooks
-compile(export_all).
init(Id, Opts) ->
- empty_scb:init(Id, Opts).
+ empty_cth:init(Id, Opts).
pre_init_per_suite(Suite, Config, State) ->
- empty_scb:pre_init_per_suite(Suite,Config,State).
+ empty_cth:pre_init_per_suite(Suite,Config,State).
post_init_per_suite(Suite,Config,Return,State) ->
- empty_scb:post_init_per_suite(Suite,Config,Return,State),
+ empty_cth:post_init_per_suite(Suite,Config,Return,State),
{{skip, "Test skip"}, State}.
pre_end_per_suite(Suite,Config,State) ->
- empty_scb:pre_end_per_suite(Suite,Config,State).
+ empty_cth:pre_end_per_suite(Suite,Config,State).
post_end_per_suite(Suite,Config,Return,State) ->
- empty_scb:post_end_per_suite(Suite,Config,Return,State).
+ empty_cth:post_end_per_suite(Suite,Config,Return,State).
pre_init_per_group(Group,Config,State) ->
- empty_scb:pre_init_per_group(Group,Config,State).
+ empty_cth:pre_init_per_group(Group,Config,State).
post_init_per_group(Group,Config,Return,State) ->
- empty_scb:post_init_per_group(Group,Config,Return,State).
+ empty_cth:post_init_per_group(Group,Config,Return,State).
pre_end_per_group(Group,Config,State) ->
- empty_scb:pre_end_per_group(Group,Config,State).
+ empty_cth:pre_end_per_group(Group,Config,State).
post_end_per_group(Group,Config,Return,State) ->
- empty_scb:post_end_per_group(Group,Config,Return,State).
+ empty_cth:post_end_per_group(Group,Config,Return,State).
pre_init_per_testcase(TC,Config,State) ->
- empty_scb:pre_init_per_testcase(TC,Config,State).
+ empty_cth:pre_init_per_testcase(TC,Config,State).
post_end_per_testcase(TC,Config,Return,State) ->
- empty_scb:post_end_per_testcase(TC,Config,Return,State).
+ empty_cth:post_end_per_testcase(TC,Config,Return,State).
on_tc_fail(TC, Reason, State) ->
- empty_scb:on_tc_fail(TC,Reason,State).
+ empty_cth:on_tc_fail(TC,Reason,State).
on_tc_skip(TC, Reason, State) ->
- empty_scb:on_tc_skip(TC,Reason,State).
+ empty_cth:on_tc_skip(TC,Reason,State).
terminate(State) ->
- empty_scb:terminate(State).
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_pre_suite_scb.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_suite_cth.erl
index 9818964e7f..49efd0d0cd 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_pre_suite_scb.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_suite_cth.erl
@@ -18,56 +18,56 @@
%%
--module(skip_pre_suite_scb).
+-module(skip_pre_suite_cth).
-include_lib("common_test/src/ct_util.hrl").
-include_lib("common_test/include/ct_event.hrl").
-%% Suite Callbacks
+%% CT Hooks
-compile(export_all).
init(Id, Opts) ->
- empty_scb:init(Id, Opts).
+ empty_cth:init(Id, Opts).
pre_init_per_suite(Suite, Config, State) ->
- empty_scb:pre_init_per_suite(Suite,Config,State),
+ empty_cth:pre_init_per_suite(Suite,Config,State),
{{skip, "Test skip"}, State}.
post_init_per_suite(Suite,Config,Return,State) ->
- empty_scb:post_init_per_suite(Suite,Config,Return,State).
+ empty_cth:post_init_per_suite(Suite,Config,Return,State).
pre_end_per_suite(Suite,Config,State) ->
- empty_scb:pre_end_per_suite(Suite,Config,State).
+ empty_cth:pre_end_per_suite(Suite,Config,State).
post_end_per_suite(Suite,Config,Return,State) ->
- empty_scb:post_end_per_suite(Suite,Config,Return,State).
+ empty_cth:post_end_per_suite(Suite,Config,Return,State).
pre_init_per_group(Group,Config,State) ->
- empty_scb:pre_init_per_group(Group,Config,State).
+ empty_cth:pre_init_per_group(Group,Config,State).
post_init_per_group(Group,Config,Return,State) ->
- empty_scb:post_init_per_group(Group,Config,Return,State).
+ empty_cth:post_init_per_group(Group,Config,Return,State).
pre_end_per_group(Group,Config,State) ->
- empty_scb:pre_end_per_group(Group,Config,State).
+ empty_cth:pre_end_per_group(Group,Config,State).
post_end_per_group(Group,Config,Return,State) ->
- empty_scb:post_end_per_group(Group,Config,Return,State).
+ empty_cth:post_end_per_group(Group,Config,Return,State).
pre_init_per_testcase(TC,Config,State) ->
- empty_scb:pre_init_per_testcase(TC,Config,State).
+ empty_cth:pre_init_per_testcase(TC,Config,State).
post_end_per_testcase(TC,Config,Return,State) ->
- empty_scb:post_end_per_testcase(TC,Config,Return,State).
+ empty_cth:post_end_per_testcase(TC,Config,Return,State).
on_tc_fail(TC, Reason, State) ->
- empty_scb:on_tc_fail(TC,Reason,State).
+ empty_cth:on_tc_fail(TC,Reason,State).
on_tc_skip(TC, Reason, State) ->
- empty_scb:on_tc_skip(TC,Reason,State).
+ empty_cth:on_tc_skip(TC,Reason,State).
terminate(State) ->
- empty_scb:terminate(State).
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/state_update_scb.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/state_update_cth.erl
index 13c50cf1a1..53d75e6ce3 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/state_update_scb.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/state_update_cth.erl
@@ -18,66 +18,66 @@
%%
--module(state_update_scb).
+-module(state_update_cth).
-include_lib("common_test/src/ct_util.hrl").
-include_lib("common_test/include/ct_event.hrl").
-%% Suite Callbacks
+%% CT Hooks
-compile(export_all).
init(Id, Opts) ->
- State = empty_scb:init(Id, Opts),
+ State = empty_cth:init(Id, Opts),
[init|State].
pre_init_per_suite(Suite, Config, State) ->
- empty_scb:pre_init_per_suite(Suite,Config,State),
+ empty_cth:pre_init_per_suite(Suite,Config,State),
{Config, [pre_init_per_suite|State]}.
post_init_per_suite(Suite,Config,Return,State) ->
- empty_scb:post_init_per_suite(Suite,Config,Return,State),
+ empty_cth:post_init_per_suite(Suite,Config,Return,State),
{Config, [post_init_per_suite|State]}.
pre_end_per_suite(Suite,Config,State) ->
- empty_scb:pre_end_per_suite(Suite,Config,State),
+ empty_cth:pre_end_per_suite(Suite,Config,State),
{Config, [pre_end_per_suite|State]}.
post_end_per_suite(Suite,Config,Return,State) ->
- empty_scb:post_end_per_suite(Suite,Config,Return,State),
+ empty_cth:post_end_per_suite(Suite,Config,Return,State),
{Return, [post_end_per_suite|State]}.
pre_init_per_group(Group,Config,State) ->
- empty_scb:pre_init_per_group(Group,Config,State),
+ empty_cth:pre_init_per_group(Group,Config,State),
{Config, [pre_init_per_group|State]}.
post_init_per_group(Group,Config,Return,State) ->
- empty_scb:post_init_per_group(Group,Config,Return,State),
+ empty_cth:post_init_per_group(Group,Config,Return,State),
{Return, [post_init_per_group|State]}.
pre_end_per_group(Group,Config,State) ->
- empty_scb:pre_end_per_group(Group,Config,State),
+ empty_cth:pre_end_per_group(Group,Config,State),
{Config, [pre_end_per_group|State]}.
post_end_per_group(Group,Config,Return,State) ->
- empty_scb:post_end_per_group(Group,Config,Return,State),
+ empty_cth:post_end_per_group(Group,Config,Return,State),
{Return, [post_end_per_group|State]}.
pre_init_per_testcase(TC,Config,State) ->
- empty_scb:pre_init_per_testcase(TC,Config,State),
+ empty_cth:pre_init_per_testcase(TC,Config,State),
{Config, [pre_init_per_testcase|State]}.
post_end_per_testcase(TC,Config,Return,State) ->
- empty_scb:post_end_per_testcase(TC,Config,Return,State),
+ empty_cth:post_end_per_testcase(TC,Config,Return,State),
{Return, [post_end_per_testcase|State]}.
on_tc_fail(TC, Reason, State) ->
- empty_scb:on_tc_fail(TC,Reason,State),
+ empty_cth:on_tc_fail(TC,Reason,State),
[on_tc_fail|State].
on_tc_skip(TC, Reason, State) ->
- empty_scb:on_tc_skip(TC,Reason,State),
+ empty_cth:on_tc_skip(TC,Reason,State),
[on_tc_skip|State].
terminate(State) ->
- empty_scb:terminate(State).
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/undef_cth.erl
index 1cb64574c3..4c44ef025b 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/undef_cth.erl
@@ -18,54 +18,54 @@
%%
--module(undef_scb).
+-module(undef_cth).
-include_lib("common_test/src/ct_util.hrl").
-include_lib("common_test/include/ct_event.hrl").
-%% Suite Callbacks
+%% CT Hooks
-compile(export_all).
init(Id, Opts) ->
- empty_scb:init(Id, Opts).
+ empty_cth:init(Id, Opts).
pre_init_per_suite(_Suite, _Config, _State) ->
lists:flaten([1,2,[3,4]]).
post_init_per_suite(Suite,Config,Return,State) ->
- empty_scb:post_init_per_suite(Suite,Config,Return,State).
+ empty_cth:post_init_per_suite(Suite,Config,Return,State).
pre_end_per_suite(Suite,Config,State) ->
- empty_scb:pre_end_per_suite(Suite,Config,State).
+ empty_cth:pre_end_per_suite(Suite,Config,State).
post_end_per_suite(Suite,Config,Return,State) ->
- empty_scb:post_end_per_suite(Suite,Config,Return,State).
+ empty_cth:post_end_per_suite(Suite,Config,Return,State).
pre_init_per_group(Group,Config,State) ->
- empty_scb:pre_init_per_group(Group,Config,State).
+ empty_cth:pre_init_per_group(Group,Config,State).
post_init_per_group(Group,Config,Return,State) ->
- empty_scb:post_init_per_group(Group,Config,Return,State).
+ empty_cth:post_init_per_group(Group,Config,Return,State).
pre_end_per_group(Group,Config,State) ->
- empty_scb:pre_end_per_group(Group,Config,State).
+ empty_cth:pre_end_per_group(Group,Config,State).
post_end_per_group(Group,Config,Return,State) ->
- empty_scb:post_end_per_group(Group,Config,Return,State).
+ empty_cth:post_end_per_group(Group,Config,Return,State).
pre_init_per_testcase(TC,Config,State) ->
- empty_scb:pre_init_per_testcase(TC,Config,State).
+ empty_cth:pre_init_per_testcase(TC,Config,State).
post_end_per_testcase(TC,Config,Return,State) ->
- empty_scb:post_end_per_testcase(TC,Config,Return,State).
+ empty_cth:post_end_per_testcase(TC,Config,Return,State).
on_tc_fail(TC, Reason, State) ->
- empty_scb:on_tc_fail(TC,Reason,State).
+ empty_cth:on_tc_fail(TC,Reason,State).
on_tc_skip(TC, Reason, State) ->
- empty_scb:on_tc_skip(TC,Reason,State).
+ empty_cth:on_tc_skip(TC,Reason,State).
terminate(State) ->
- empty_scb:terminate(State).
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/update_config_scb.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl
index 46a027403d..788ef2cec2 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/update_config_scb.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl
@@ -18,65 +18,65 @@
%%
--module(update_config_scb).
+-module(update_config_cth).
-include_lib("common_test/src/ct_util.hrl").
-include_lib("common_test/include/ct_event.hrl").
-%% Suite Callbacks
+%% CT Hooks
-compile(export_all).
init(Id, Opts) ->
- empty_scb:init(Id, Opts).
+ empty_cth:init(Id, Opts).
pre_init_per_suite(Suite, Config, State) ->
- empty_scb:pre_init_per_suite(Suite,Config,State),
+ empty_cth:pre_init_per_suite(Suite,Config,State),
{[{pre_init_per_suite,now()}|Config],State}.
post_init_per_suite(Suite,Config,Return,State) ->
- empty_scb:post_init_per_suite(Suite,Config,Return,State),
+ empty_cth:post_init_per_suite(Suite,Config,Return,State),
{[{post_init_per_suite,now()}|Return],State}.
pre_end_per_suite(Suite,Config,State) ->
- empty_scb:pre_end_per_suite(Suite,Config,State),
+ empty_cth:pre_end_per_suite(Suite,Config,State),
{[{pre_end_per_suite,now()}|Config],State}.
post_end_per_suite(Suite,Config,Return,State) ->
- empty_scb:post_end_per_suite(Suite,Config,Return,State),
+ empty_cth:post_end_per_suite(Suite,Config,Return,State),
NewConfig = [{post_end_per_suite,now()}|Config],
{NewConfig,NewConfig}.
pre_init_per_group(Group,Config,State) ->
- empty_scb:pre_init_per_group(Group,Config,State),
+ empty_cth:pre_init_per_group(Group,Config,State),
{[{pre_init_per_group,now()}|Config],State}.
post_init_per_group(Group,Config,Return,State) ->
- empty_scb:post_init_per_group(Group,Config,Return,State),
+ empty_cth:post_init_per_group(Group,Config,Return,State),
{[{post_init_per_group,now()}|Return],State}.
pre_end_per_group(Group,Config,State) ->
- empty_scb:pre_end_per_group(Group,Config,State),
+ empty_cth:pre_end_per_group(Group,Config,State),
{[{pre_end_per_group,now()}|Config],State}.
post_end_per_group(Group,Config,Return,State) ->
- empty_scb:post_end_per_group(Group,Config,Return,State),
+ empty_cth:post_end_per_group(Group,Config,Return,State),
{[{post_end_per_group,now()}|Config],State}.
pre_init_per_testcase(TC,Config,State) ->
- empty_scb:pre_init_per_testcase(TC,Config,State),
+ empty_cth:pre_init_per_testcase(TC,Config,State),
{[{pre_init_per_testcase,now()}|Config],State}.
post_end_per_testcase(TC,Config,Return,State) ->
- empty_scb:post_end_per_testcase(TC,Config,Return,State),
+ empty_cth:post_end_per_testcase(TC,Config,Return,State),
{[{post_end_per_testcase,now()}|Config],State}.
on_tc_fail(TC, Reason, State) ->
- empty_scb:on_tc_fail(TC,Reason,State).
+ empty_cth:on_tc_fail(TC,Reason,State).
on_tc_skip(TC, Reason, State) ->
- empty_scb:on_tc_skip(TC,Reason,State).
+ empty_cth:on_tc_skip(TC,Reason,State).
terminate(State) ->
- empty_scb:terminate(State).
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl
deleted file mode 100644
index 67f3cf430a..0000000000
--- a/lib/common_test/test/ct_suite_callback_SUITE.erl
+++ /dev/null
@@ -1,1021 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2009-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%
-%%
-
-%%%-------------------------------------------------------------------
-%%% File: ct_error_SUITE
-%%%
-%%% Description:
-%%% Test various errors in Common Test suites.
-%%%
-%%% The suites used for the test are located in the data directory.
-%%%-------------------------------------------------------------------
--module(ct_suite_callback_SUITE).
-
--compile(export_all).
-
--include_lib("test_server/include/test_server.hrl").
--include_lib("common_test/include/ct_event.hrl").
-
--define(eh, ct_test_support_eh).
-
-%%--------------------------------------------------------------------
-%% TEST SERVER CALLBACK FUNCTIONS
-%%--------------------------------------------------------------------
-
-%%--------------------------------------------------------------------
-%% Description: Since Common Test starts another Test Server
-%% instance, the tests need to be performed on a separate node (or
-%% there will be clashes with logging processes etc).
-%%--------------------------------------------------------------------
-init_per_suite(Config) ->
- DataDir = ?config(data_dir, Config),
- TestDir = filename:join(DataDir,"scb/tests/"),
- SCBs = filelib:wildcard(filename:join(TestDir,"*_scb.erl")),
- io:format("SCBs: ~p",[SCBs]),
- [io:format("Compiling ~p: ~p",
- [FileName,compile:file(FileName,[{outdir,TestDir},debug_info])]) ||
- FileName <- SCBs],
- ct_test_support:init_per_suite([{path_dirs,[TestDir]} | Config]).
-
-end_per_suite(Config) ->
- ct_test_support:end_per_suite(Config).
-
-init_per_testcase(TestCase, Config) ->
- ct_test_support:init_per_testcase(TestCase, Config).
-
-end_per_testcase(TestCase, Config) ->
- ct_test_support:end_per_testcase(TestCase, Config).
-
-
-suite() ->
- [{timetrap,{seconds,20}}].
-
-all() ->
- all(suite).
-
-all(suite) ->
- lists:reverse(
- [
- one_scb, two_scb, faulty_scb_no_init, faulty_scb_id_no_init,
- faulty_scb_exit_in_init, faulty_scb_exit_in_id,
- 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,
- 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, options_scb, same_id_scb,
- fail_n_skip_with_minimal_scb
- ]
- )
- .
-
-
-%%--------------------------------------------------------------------
-%% TEST CASES
-%%--------------------------------------------------------------------
-
-%%%-----------------------------------------------------------------
-%%%
-one_scb(Config) when is_list(Config) ->
- do_test(one_empty_scb, "ct_scb_empty_SUITE.erl",[empty_scb], Config).
-
-two_scb(Config) when is_list(Config) ->
- do_test(two_empty_scb, "ct_scb_empty_SUITE.erl",[empty_scb,empty_scb],
- Config).
-
-faulty_scb_no_init(Config) when is_list(Config) ->
- do_test(faulty_scb_no_init, "ct_scb_empty_SUITE.erl",[askjhdkljashdkaj],
- Config,{error,"Failed to start SCB, see the "
- "CT Log for details"}).
-
-faulty_scb_id_no_init(Config) when is_list(Config) ->
- do_test(faulty_scb_id_no_init, "ct_scb_empty_SUITE.erl",[id_no_init_scb],
- Config,{error,"Failed to start SCB, see the "
- "CT Log for details"}).
-
-minimal_scb(Config) when is_list(Config) ->
- do_test(minimal_scb, "ct_scb_empty_SUITE.erl",[minimal_scb],Config).
-
-minimal_and_maximal_scb(Config) when is_list(Config) ->
- do_test(minimal_and_maximal_scb, "ct_scb_empty_SUITE.erl",
- [minimal_scb, empty_scb],Config).
-
-faulty_scb_undef(Config) when is_list(Config) ->
- do_test(faulty_scb_undef, "ct_scb_empty_SUITE.erl",
- [undef_scb],Config).
-
-faulty_scb_exit_in_init_scope_suite(Config) when is_list(Config) ->
- do_test(faulty_scb_exit_in_init_scope_suite,
- "ct_exit_in_init_scope_suite_scb_SUITE.erl",
- [],Config).
-
-faulty_scb_exit_in_init(Config) when is_list(Config) ->
- do_test(faulty_scb_exit_in_init, "ct_scb_empty_SUITE.erl",
- [crash_init_scb], Config,
- {error,"Failed to start SCB, see the "
- "CT Log for details"}).
-
-faulty_scb_exit_in_id(Config) when is_list(Config) ->
- do_test(faulty_scb_exit_in_id, "ct_scb_empty_SUITE.erl",
- [crash_id_scb], Config,
- {error,"Failed to start SCB, see the "
- "CT Log for details"}).
-
-scope_per_suite_scb(Config) when is_list(Config) ->
- do_test(scope_per_suite_scb, "ct_scope_per_suite_scb_SUITE.erl",
- [],Config).
-
-scope_suite_scb(Config) when is_list(Config) ->
- do_test(scope_suite_scb, "ct_scope_suite_scb_SUITE.erl",
- [],Config).
-
-scope_per_group_scb(Config) when is_list(Config) ->
- do_test(scope_per_group_scb, "ct_scope_per_group_scb_SUITE.erl",
- [],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) 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) 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) 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) 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) when is_list(Config) ->
- do_test(update_config_scb, "ct_update_config_SUITE.erl",
- [update_config_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).
-
-same_id_scb(Config) when is_list(Config) ->
- do_test(same_id_scb, "ct_scb_empty_SUITE.erl",
- [same_id_scb,same_id_scb],Config).
-
-fail_n_skip_with_minimal_scb(Config) when is_list(Config) ->
- do_test(fail_n_skip_with_minimal_scb, "ct_scb_fail_one_skip_one_SUITE.erl",
- [minimal_terminate_scb],Config).
-
-%%%-----------------------------------------------------------------
-%%% HELP FUNCTIONS
-%%%-----------------------------------------------------------------
-
-do_test(Tag, SWC, SCBs, Config) ->
- do_test(Tag, SWC, SCBs, Config, ok).
-do_test(Tag, SWC, SCBs, Config, {error,_} = Res) ->
- do_test(Tag, SWC, SCBs, Config, Res, 1);
-do_test(Tag, SWC, SCBs, Config, Res) ->
- do_test(Tag, SWC, SCBs, Config, Res, 2).
-
-do_test(Tag, SuiteWildCard, SCBs, Config, Res, EC) ->
-
- DataDir = ?config(data_dir, Config),
- Suites = filelib:wildcard(
- filename:join([DataDir,"scb/tests",SuiteWildCard])),
- {Opts,ERPid} = setup([{suite,Suites},
- {suite_callbacks,SCBs},{label,Tag}], Config),
- Res = ct_test_support:run(Opts, Config),
- Events = ct_test_support:get_events(ERPid, Config),
-
- ct_test_support:log_events(Tag,
- reformat(Events, ?eh),
- ?config(priv_dir, Config)),
-
- TestEvents = events_to_check(Tag, EC),
- ok = ct_test_support:verify_events(TestEvents, Events, Config).
-
-setup(Test, Config) ->
- Opts0 = ct_test_support:get_opts(Config),
- Level = ?config(trace_level, Config),
- EvHArgs = [{cbm,ct_test_support},{trace_level,Level}],
- Opts = Opts0 ++ [{event_handler,{?eh,EvHArgs}}|Test],
- ERPid = ct_test_support:start_event_receiver(Config),
- {Opts,ERPid}.
-
-reformat(Events, EH) ->
- ct_test_support:reformat(Events, EH).
-%reformat(Events, _EH) ->
-% Events.
-
-%%%-----------------------------------------------------------------
-%%% TEST EVENTS
-%%%-----------------------------------------------------------------
-events_to_check(Test) ->
- %% 2 tests (ct:run_test + script_start) is default
- events_to_check(Test, 2).
-
-events_to_check(_, 0) ->
- [];
-events_to_check(Test, N) ->
- test_events(Test) ++ events_to_check(Test, N-1).
-
-test_events(one_empty_scb) ->
- [
- {?eh,start_logging,{'DEF','RUNDIR'}},
- {?eh,scb,{empty_scb,id,[[]]}},
- {?eh,scb,{empty_scb,init,[{'_','_','_'},[]]}},
- {?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',[]]}},
- {?eh,scb,{empty_scb,post_init_per_suite,
- [ct_scb_empty_SUITE,'$proplist','$proplist',[]]}},
- {?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',[]]}},
- {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,'$proplist','_',[]]}},
- {?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',[]]}},
- {?eh,scb,{empty_scb,post_end_per_suite,[ct_scb_empty_SUITE,'$proplist','_',[]]}},
- {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}},
- {?eh,test_done,{'DEF','STOP_TIME'}},
- {?eh,scb,{empty_scb,terminate,[[]]}},
- {?eh,stop_logging,[]}
- ];
-
-test_events(two_empty_scb) ->
- [
- {?eh,start_logging,{'DEF','RUNDIR'}},
- {?eh,scb,{'_',id,[[]]}},
- {?eh,scb,{'_',init,['_',[]]}},
- {?eh,scb,{'_',id,[[]]}},
- {?eh,scb,{'_',init,['_',[]]}},
- {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
- {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}},
- {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}},
- {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}},
- {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist','$proplist',[]]}},
- {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist','$proplist',[]]}},
- {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}},
-
- {?eh,tc_start,{ct_scb_empty_SUITE,test_case}},
- {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}},
- {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}},
- {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}},
- {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}},
- {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}},
-
- {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}},
- {?eh,scb,{'_',pre_end_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}},
- {?eh,scb,{'_',pre_end_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}},
- {?eh,scb,{'_',post_end_per_suite,[ct_scb_empty_SUITE,'$proplist','_',[]]}},
- {?eh,scb,{'_',post_end_per_suite,[ct_scb_empty_SUITE,'$proplist','_',[]]}},
- {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}},
- {?eh,test_done,{'DEF','STOP_TIME'}},
- {?eh,scb,{'_',terminate,[[]]}},
- {?eh,scb,{'_',terminate,[[]]}},
- {?eh,stop_logging,[]}
- ];
-
-test_events(faulty_scb_no_init) ->
- [
- {?eh,start_logging,{'DEF','RUNDIR'}},
- {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
- {?eh,test_done,{'DEF','STOP_TIME'}},
- {?eh,stop_logging,[]}
- ];
-
-test_events(faulty_scb_id_no_init) ->
- [
- {?eh,start_logging,{'DEF','RUNDIR'}},
- {?eh,scb,{'_',id,[[]]}},
- {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
- {negative,{?eh,tc_start,'_'},
- {?eh,test_done,{'DEF','STOP_TIME'}}},
- {?eh,stop_logging,[]}
- ];
-
-test_events(minimal_scb) ->
- [
- {?eh,start_logging,{'DEF','RUNDIR'}},
- {negative,{?eh,scb,{'_',id,['_',[]]}},
- {?eh,scb,{'_',init,['_',[]]}}},
- {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
- {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}},
- {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}},
-
- {?eh,tc_start,{ct_scb_empty_SUITE,test_case}},
- {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}},
-
- {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}},
- {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}},
- {?eh,test_done,{'DEF','STOP_TIME'}},
- {?eh,stop_logging,[]}
- ];
-
-test_events(minimal_and_maximal_scb) ->
- [
- {?eh,start_logging,{'DEF','RUNDIR'}},
- {negative,{?eh,scb,{'_',id,['_',[]]}},
- {?eh,scb,{'_',init,['_',[]]}}},
- {?eh,scb,{'_',id,[[]]}},
- {?eh,scb,{'_',init,['_',[]]}},
- {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
- {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}},
- {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}},
- {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist','$proplist',[]]}},
- {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}},
-
- {?eh,tc_start,{ct_scb_empty_SUITE,test_case}},
- {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}},
- {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}},
- {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}},
-
- {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}},
- {?eh,scb,{'_',pre_end_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}},
- {?eh,scb,{'_',post_end_per_suite,[ct_scb_empty_SUITE,'$proplist','_',[]]}},
- {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}},
- {?eh,test_done,{'DEF','STOP_TIME'}},
- {?eh,scb,{'_',terminate,[[]]}},
- {?eh,stop_logging,[]}
- ];
-
-test_events(faulty_scb_undef) ->
- FailReasonStr = "undef_scb:pre_init_per_suite/3 SCB call failed",
- FailReason = {ct_scb_empty_SUITE,init_per_suite,
- {failed,FailReasonStr}},
- [
- {?eh,start_logging,{'DEF','RUNDIR'}},
- {?eh,scb,{'_',init,['_',[]]}},
- {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
- {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}},
- {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,
- {failed, {error,FailReasonStr}}}},
- {?eh,scb,{'_',on_tc_fail,'_'}},
-
- {?eh,tc_auto_skip,{ct_scb_empty_SUITE,test_case,
- {failed, FailReason}}},
- {?eh,scb,{'_',on_tc_skip,'_'}},
-
- {?eh,tc_auto_skip,{ct_scb_empty_SUITE,end_per_suite,
- {failed, FailReason}}},
- {?eh,scb,{'_',on_tc_skip,'_'}},
-
- {?eh,test_done,{'DEF','STOP_TIME'}},
- {?eh,stop_logging,[]}
- ];
-
-test_events(faulty_scb_exit_in_init_scope_suite) ->
- [{?eh,start_logging,{'DEF','RUNDIR'}},
- {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
- {?eh,tc_start,{'_',init_per_suite}},
- {?eh,scb,{empty_scb,init,['_',[]]}},
- {?eh,tc_done,
- {ct_exit_in_init_scope_suite_scb_SUITE,init_per_suite,
- {failed,
- {error,
- "Failed to start SCB, see the CT Log for details"}}}},
- {?eh,tc_auto_skip,
- {ct_exit_in_init_scope_suite_scb_SUITE,test_case,
- {failed,
- {ct_exit_in_init_scope_suite_scb_SUITE,init_per_suite,
- {failed,
- "Failed to start SCB, see the CT Log for details"}}}}},
- {?eh,tc_auto_skip,
- {ct_exit_in_init_scope_suite_scb_SUITE,end_per_suite,
- {failed,
- {ct_exit_in_init_scope_suite_scb_SUITE,init_per_suite,
- {failed,
- "Failed to start SCB, see the CT Log for details"}}}}},
- {?eh,test_done,{'DEF','STOP_TIME'}},
- {?eh,stop_logging,[]}];
-
-test_events(faulty_scb_exit_in_init) ->
- [{?eh,start_logging,{'DEF','RUNDIR'}},
- {?eh,scb,{empty_scb,init,['_',[]]}},
- {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
- {?eh,test_done,{'DEF','STOP_TIME'}},
- {?eh,stop_logging,[]}];
-
-test_events(faulty_scb_exit_in_id) ->
- [{?eh,start_logging,{'DEF','RUNDIR'}},
- {?eh,scb,{empty_scb,id,[[]]}},
- {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
- {negative, {?eh,tc_start,'_'},
- {?eh,test_done,{'DEF','STOP_TIME'}}},
- {?eh,stop_logging,[]}];
-
-test_events(scope_per_suite_scb) ->
- [
- {?eh,start_logging,{'DEF','RUNDIR'}},
- {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
- {?eh,tc_start,{ct_scope_per_suite_scb_SUITE,init_per_suite}},
- {?eh,scb,{'_',id,[[]]}},
- {?eh,scb,{'_',init,['_',[]]}},
- {?eh,scb,{'_',post_init_per_suite,[ct_scope_per_suite_scb_SUITE,'$proplist','$proplist',[]]}},
- {?eh,tc_done,{ct_scope_per_suite_scb_SUITE,init_per_suite,ok}},
-
- {?eh,tc_start,{ct_scope_per_suite_scb_SUITE,test_case}},
- {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}},
- {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}},
- {?eh,tc_done,{ct_scope_per_suite_scb_SUITE,test_case,ok}},
-
- {?eh,tc_start,{ct_scope_per_suite_scb_SUITE,end_per_suite}},
- {?eh,scb,{'_',pre_end_per_suite,
- [ct_scope_per_suite_scb_SUITE,'$proplist',[]]}},
- {?eh,scb,{'_',post_end_per_suite,[ct_scope_per_suite_scb_SUITE,'$proplist','_',[]]}},
- {?eh,scb,{'_',terminate,[[]]}},
- {?eh,tc_done,{ct_scope_per_suite_scb_SUITE,end_per_suite,ok}},
- {?eh,test_done,{'DEF','STOP_TIME'}},
- {?eh,stop_logging,[]}
- ];
-
-test_events(scope_suite_scb) ->
- [
- {?eh,start_logging,{'DEF','RUNDIR'}},
- {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
- {?eh,tc_start,{ct_scope_suite_scb_SUITE,init_per_suite}},
- {?eh,scb,{'_',id,[[]]}},
- {?eh,scb,{'_',init,['_',[]]}},
- {?eh,scb,{'_',pre_init_per_suite,[ct_scope_suite_scb_SUITE,'$proplist',[]]}},
- {?eh,scb,{'_',post_init_per_suite,[ct_scope_suite_scb_SUITE,'$proplist','$proplist',[]]}},
- {?eh,tc_done,{ct_scope_suite_scb_SUITE,init_per_suite,ok}},
-
- {?eh,tc_start,{ct_scope_suite_scb_SUITE,test_case}},
- {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}},
- {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}},
- {?eh,tc_done,{ct_scope_suite_scb_SUITE,test_case,ok}},
-
- {?eh,tc_start,{ct_scope_suite_scb_SUITE,end_per_suite}},
- {?eh,scb,{'_',pre_end_per_suite,[ct_scope_suite_scb_SUITE,'$proplist',[]]}},
- {?eh,scb,{'_',post_end_per_suite,[ct_scope_suite_scb_SUITE,'$proplist','_',[]]}},
- {?eh,scb,{'_',terminate,[[]]}},
- {?eh,tc_done,{ct_scope_suite_scb_SUITE,end_per_suite,ok}},
- {?eh,test_done,{'DEF','STOP_TIME'}},
- {?eh,stop_logging,[]}
- ];
-
-test_events(scope_per_group_scb) ->
- [
- {?eh,start_logging,{'DEF','RUNDIR'}},
- {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
- {?eh,tc_start,{ct_scope_per_group_scb_SUITE,init_per_suite}},
- {?eh,tc_done,{ct_scope_per_group_scb_SUITE,init_per_suite,ok}},
-
- [{?eh,tc_start,{ct_scope_per_group_scb_SUITE,{init_per_group,group1,[]}}},
- {?eh,scb,{'_',id,[[]]}},
- {?eh,scb,{'_',init,['_',[]]}},
- {?eh,scb,{'_',post_init_per_group,[group1,'$proplist','$proplist',[]]}},
- {?eh,tc_done,{ct_scope_per_group_scb_SUITE,{init_per_group,group1,[]},ok}},
-
- {?eh,tc_start,{ct_scope_per_group_scb_SUITE,test_case}},
- {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}},
- {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}},
- {?eh,tc_done,{ct_scope_per_group_scb_SUITE,test_case,ok}},
-
- {?eh,tc_start,{ct_scope_per_group_scb_SUITE,{end_per_group,group1,[]}}},
- {?eh,scb,{'_',pre_end_per_group,[group1,'$proplist',[]]}},
- {?eh,scb,{'_',post_end_per_group,[group1,'$proplist','_',[]]}},
- {?eh,scb,{'_',terminate,[[]]}},
- {?eh,tc_done,{ct_scope_per_group_scb_SUITE,{end_per_group,group1,[]},ok}}],
-
- {?eh,tc_start,{ct_scope_per_group_scb_SUITE,end_per_suite}},
- {?eh,tc_done,{ct_scope_per_group_scb_SUITE,end_per_suite,ok}},
- {?eh,test_done,{'DEF','STOP_TIME'}},
- {?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,{'_',id,[[test]]}},
- {?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,{'_',id,[[test]]}},
- {?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,{'_',id,[[test]]}},
- {?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'}},
- {?eh,scb,{'_',init,['_',[]]}},
- {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
-
-
- {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}},
- {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}},
- {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist',
- {fail,"Test failure"},[]]}},
- {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,
- {failed, {error,"Test failure"}}}},
- {?eh,scb,{'_',on_tc_fail,
- [init_per_suite,{failed,"Test failure"},[]]}},
-
-
- {?eh,tc_auto_skip,{ct_scb_empty_SUITE,test_case,
- {failed,{ct_scb_empty_SUITE,init_per_suite,
- {failed,"Test failure"}}}}},
- {?eh,scb,{'_',on_tc_skip,
- [test_case, {tc_auto_skip,
- {failed, {ct_scb_empty_SUITE, init_per_suite,
- {failed, "Test failure"}}}},[]]}},
-
-
- {?eh,tc_auto_skip, {ct_scb_empty_SUITE, end_per_suite,
- {failed, {ct_scb_empty_SUITE, init_per_suite,
- {failed, "Test failure"}}}}},
- {?eh,scb,{'_',on_tc_skip,
- [end_per_suite, {tc_auto_skip,
- {failed, {ct_scb_empty_SUITE, init_per_suite,
- {failed, "Test failure"}}}},[]]}},
-
-
- {?eh,test_done,{'DEF','STOP_TIME'}},
- {?eh,scb, {'_',terminate,[[]]}},
- {?eh,stop_logging,[]}
- ];
-
-test_events(fail_post_suite_scb) ->
- [
- {?eh,start_logging,{'DEF','RUNDIR'}},
- {?eh,scb,{'_',init,['_',[]]}},
- {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
- {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}},
- {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}},
- {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist','$proplist',[]]}},
- {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,
- {failed,{error,"Test failure"}}}},
- {?eh,scb,{'_',on_tc_fail,[init_per_suite, {failed,"Test failure"}, []]}},
-
- {?eh,tc_auto_skip,{ct_scb_empty_SUITE,test_case,
- {failed,{ct_scb_empty_SUITE,init_per_suite,
- {failed,"Test failure"}}}}},
- {?eh,scb,{'_',on_tc_skip,[test_case,{tc_auto_skip,'_'},[]]}},
-
- {?eh,tc_auto_skip, {ct_scb_empty_SUITE, end_per_suite,
- {failed, {ct_scb_empty_SUITE, init_per_suite,
- {failed, "Test failure"}}}}},
- {?eh,scb,{'_',on_tc_skip,[end_per_suite,{tc_auto_skip,'_'},[]]}},
-
- {?eh,test_done,{'DEF','STOP_TIME'}},
- {?eh,scb, {'_',terminate,[[]]}},
- {?eh,stop_logging,[]}
- ];
-
-test_events(skip_pre_suite_scb) ->
- [
- {?eh,start_logging,{'DEF','RUNDIR'}},
- {?eh,scb,{'_',init,['_',[]]}},
- {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
- {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}},
- {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}},
- {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist',{skip,"Test skip"},[]]}},
- {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,{skipped,"Test skip"}}},
- {?eh,scb,{'_',on_tc_skip,
- [init_per_suite,{tc_user_skip,{skipped,"Test skip"}},[]]}},
-
- {?eh,tc_auto_skip,{ct_scb_empty_SUITE,test_case,"Test skip"}},
- {?eh,scb,{'_',on_tc_skip,[test_case,{tc_auto_skip,"Test skip"},[]]}},
-
- {?eh,tc_auto_skip, {ct_scb_empty_SUITE, end_per_suite,"Test skip"}},
- {?eh,scb,{'_',on_tc_skip,[end_per_suite,{tc_auto_skip,"Test skip"},[]]}},
-
- {?eh,test_done,{'DEF','STOP_TIME'}},
- {?eh,scb, {'_',terminate,[[]]}},
- {?eh,stop_logging,[]}
- ];
-
-test_events(skip_post_suite_scb) ->
- [
- {?eh,start_logging,{'DEF','RUNDIR'}},
- {?eh,scb,{'_',init,['_',[]]}},
- {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
-
- {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}},
- {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}},
- {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist','$proplist',[]]}},
- {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,{skipped,"Test skip"}}},
- {?eh,scb,{'_',on_tc_skip,
- [init_per_suite,{tc_user_skip,{skipped,"Test skip"}},[]]}},
-
- {?eh,tc_auto_skip,{ct_scb_empty_SUITE,test_case,"Test skip"}},
- {?eh,scb,{'_',on_tc_skip,[test_case,{tc_auto_skip,"Test skip"},[]]}},
-
- {?eh,tc_auto_skip, {ct_scb_empty_SUITE, end_per_suite,"Test skip"}},
- {?eh,scb,{'_',on_tc_skip,[end_per_suite,{tc_auto_skip,"Test skip"},[]]}},
-
- {?eh,test_done,{'DEF','STOP_TIME'}},
- {?eh,scb,{'_',terminate,[[]]}},
- {?eh,stop_logging,[]}
- ];
-
-test_events(recover_post_suite_scb) ->
- Suite = ct_scb_fail_per_suite_SUITE,
- [
- {?eh,start_logging,'_'},
- {?eh,scb,{'_',init,['_',[]]}},
- {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
- {?eh,tc_start,{Suite,init_per_suite}},
- {?eh,scb,{'_',pre_init_per_suite,[Suite,'$proplist','$proplist']}},
- {?eh,scb,{'_',post_init_per_suite,[Suite,contains([tc_status]),
- {'EXIT',{'_','_'}},[]]}},
- {?eh,tc_done,{Suite,init_per_suite,ok}},
-
- {?eh,tc_start,{Suite,test_case}},
- {?eh,scb,{'_',pre_init_per_testcase,
- [test_case, not_contains([tc_status]),[]]}},
- {?eh,scb,{'_',post_end_per_testcase,
- [test_case, contains([tc_status]),'_',[]]}},
- {?eh,tc_done,{Suite,test_case,ok}},
-
- {?eh,tc_start,{Suite,end_per_suite}},
- {?eh,scb,{'_',pre_end_per_suite,
- [Suite,not_contains([tc_status]),[]]}},
- {?eh,scb,{'_',post_end_per_suite,
- [Suite,not_contains([tc_status]),'_',[]]}},
- {?eh,tc_done,{Suite,end_per_suite,ok}},
- {?eh,test_done,{'DEF','STOP_TIME'}},
- {?eh,scb,{'_',terminate,[[]]}},
- {?eh,stop_logging,[]}
- ];
-
-test_events(update_config_scb) ->
- [
- {?eh,start_logging,{'DEF','RUNDIR'}},
- {?eh,scb,{'_',init,['_',[]]}},
- {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
-
- {?eh,tc_start,{ct_update_config_SUITE,init_per_suite}},
- {?eh,scb,{'_',pre_init_per_suite,
- [ct_update_config_SUITE,contains([]),[]]}},
- {?eh,scb,{'_',post_init_per_suite,
- [ct_update_config_SUITE,
- '$proplist',
- contains(
- [init_per_suite,
- pre_init_per_suite]),
- []]}},
- {?eh,tc_done,{ct_update_config_SUITE,init_per_suite,ok}},
-
- {?eh,tc_start,{ct_update_config_SUITE, {init_per_group,group1,[]}}},
- {?eh,scb,{'_',pre_init_per_group,
- [group1,contains(
- [post_init_per_suite,
- init_per_suite,
- pre_init_per_suite]),
- []]}},
- {?eh,scb,{'_',post_init_per_group,
- [group1,
- contains(
- [post_init_per_suite,
- init_per_suite,
- pre_init_per_suite]),
- contains(
- [init_per_group,
- pre_init_per_group,
- post_init_per_suite,
- init_per_suite,
- pre_init_per_suite]),
- []]}},
- {?eh,tc_done,{ct_update_config_SUITE,{init_per_group,group1,[]},ok}},
-
- {?eh,tc_start,{ct_update_config_SUITE,test_case}},
- {?eh,scb,{'_',pre_init_per_testcase,
- [test_case,contains(
- [post_init_per_group,
- init_per_group,
- pre_init_per_group,
- post_init_per_suite,
- init_per_suite,
- pre_init_per_suite]),
- []]}},
- {?eh,scb,{'_',post_end_per_testcase,
- [test_case,contains(
- [init_per_testcase,
- pre_init_per_testcase,
- post_init_per_group,
- init_per_group,
- pre_init_per_group,
- post_init_per_suite,
- init_per_suite,
- pre_init_per_suite]),
- ok,[]]}},
- {?eh,tc_done,{ct_update_config_SUITE,test_case,ok}},
-
- {?eh,tc_start,{ct_update_config_SUITE, {end_per_group,group1,[]}}},
- {?eh,scb,{'_',pre_end_per_group,
- [group1,contains(
- [post_init_per_group,
- init_per_group,
- pre_init_per_group,
- post_init_per_suite,
- init_per_suite,
- pre_init_per_suite]),
- []]}},
- {?eh,scb,{'_',post_end_per_group,
- [group1,
- contains(
- [pre_end_per_group,
- post_init_per_group,
- init_per_group,
- pre_init_per_group,
- post_init_per_suite,
- init_per_suite,
- pre_init_per_suite]),
- ok,[]]}},
- {?eh,tc_done,{ct_update_config_SUITE,{end_per_group,group1,[]},ok}},
-
- {?eh,tc_start,{ct_update_config_SUITE,end_per_suite}},
- {?eh,scb,{'_',pre_end_per_suite,
- [ct_update_config_SUITE,contains(
- [post_init_per_suite,
- init_per_suite,
- pre_init_per_suite]),
- []]}},
- {?eh,scb,{'_',post_end_per_suite,
- [ct_update_config_SUITE,contains(
- [pre_end_per_suite,
- post_init_per_suite,
- init_per_suite,
- pre_init_per_suite]),
- '_',[]]}},
- {?eh,tc_done,{ct_update_config_SUITE,end_per_suite,ok}},
- {?eh,test_done,{'DEF','STOP_TIME'}},
- {?eh,scb,{'_',terminate,[contains(
- [post_end_per_suite,
- pre_end_per_suite,
- post_init_per_suite,
- init_per_suite,
- pre_init_per_suite])]}},
- {?eh,stop_logging,[]}
- ];
-
-test_events(state_update_scb) ->
- [
- {?eh,start_logging,{'DEF','RUNDIR'}},
- {?eh,scb,{'_',init,['_',[]]}},
- {?eh,scb,{'_',init,['_',[]]}},
- {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
- {?eh,tc_start,{'_',init_per_suite}},
-
- {?eh,tc_done,{'_',end_per_suite,ok}},
- {?eh,test_done,{'DEF','STOP_TIME'}},
- {?eh,scb,{'_',terminate,[contains(
- [post_end_per_suite,pre_end_per_suite,
- post_end_per_group,pre_end_per_group,
- {not_in_order,
- [post_end_per_testcase,pre_init_per_testcase,
- on_tc_skip,post_end_per_testcase,
- pre_init_per_testcase,on_tc_fail,
- post_end_per_testcase,pre_init_per_testcase]
- },
- post_init_per_group,pre_init_per_group,
- post_init_per_suite,pre_init_per_suite,
- init])]}},
- {?eh,scb,{'_',terminate,[contains(
- [post_end_per_suite,pre_end_per_suite,
- post_end_per_group,pre_end_per_group,
- {not_in_order,
- [post_end_per_testcase,pre_init_per_testcase,
- on_tc_skip,post_end_per_testcase,
- pre_init_per_testcase,on_tc_fail,
- post_end_per_testcase,pre_init_per_testcase]
- },
- post_init_per_group,pre_init_per_group,
- post_init_per_suite,pre_init_per_suite,
- init]
- )]}},
- {?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(same_id_scb) ->
- [
- {?eh,start_logging,{'DEF','RUNDIR'}},
- {?eh,scb,{'_',id,[[]]}},
- {?eh,scb,{'_',init,[same_id_scb,[]]}},
- {?eh,scb,{'_',id,[[]]}},
- {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
- {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}},
- {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}},
- {negative,
- {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}},
- {?eh,scb,{'_',post_init_per_suite,
- [ct_scb_empty_SUITE,'$proplist','$proplist',[]]}}},
- {negative,
- {?eh,scb,{'_',post_init_per_suite,
- [ct_scb_empty_SUITE,'$proplist','$proplist',[]]}},
- {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}},
-
- {?eh,tc_start,{ct_scb_empty_SUITE,test_case}},
- {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}},
- {negative,
- {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}},
- {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}},
- {negative,
- {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}},
- {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}},
-
- {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}},
- {?eh,scb,{'_',pre_end_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}},
- {negative,
- {?eh,scb,{'_',pre_end_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}},
- {?eh,scb,{'_',post_end_per_suite,[ct_scb_empty_SUITE,'$proplist','_',[]]}}},
- {negative,
- {?eh,scb,{'_',post_end_per_suite,
- [ct_scb_empty_SUITE,'$proplist','_',[]]}},
- {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}},
- {?eh,test_done,{'DEF','STOP_TIME'}},
- {?eh,scb,{'_',terminate,[[]]}},
- {?eh,stop_logging,[]}
- ];
-
-test_events(fail_n_skip_with_minimal_scb) ->
- [{?eh,start_logging,{'DEF','RUNDIR'}},
- {?eh,scb,{'_',init,['_',[]]}},
- {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
- {?eh,tc_start,{'_',init_per_suite}},
-
- {?eh,tc_done,{'_',end_per_suite,ok}},
- {?eh,scb,{'_',terminate,[[]]}},
- {?eh,stop_logging,[]}
- ];
-
-test_events(ok) ->
- ok.
-
-
-%% test events help functions
-contains(List) ->
- fun(Proplist) when is_list(Proplist) ->
- contains(List,Proplist)
- end.
-
-contains([{not_in_order,List}|T],Rest) ->
- contains_parallel(List,Rest),
- contains(T,Rest);
-contains([{Ele,Pos}|T] = L,[H|T2]) ->
- case element(Pos,H) of
- Ele ->
- contains(T,T2);
- _ ->
- contains(L,T2)
- end;
-contains([Ele|T],[{Ele,_}|T2])->
- contains(T,T2);
-contains([Ele|T],[Ele|T2])->
- contains(T,T2);
-contains(List,[_|T]) ->
- contains(List,T);
-contains([],_) ->
- match.
-
-contains_parallel([Key | T], Elems) ->
- contains([Key],Elems),
- contains_parallel(T,Elems);
-contains_parallel([],_Elems) ->
- match.
-
-not_contains(List) ->
- fun(Proplist) when is_list(Proplist) ->
- [] = [Ele || {Ele,_} <- Proplist,
- Test <- List,
- Test =:= Ele]
- end.