diff options
author | Lukas Larsson <[email protected]> | 2010-11-24 14:29:02 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2010-12-08 18:07:54 +0100 |
commit | 0908ef629325d2aed93f654ea78949205060a013 (patch) | |
tree | abd2cd919b7c294d621eaef95b4aab48d1161f53 /lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests | |
parent | e6a27219093c22e6d63025078de9926590816f7c (diff) | |
download | otp-0908ef629325d2aed93f654ea78949205060a013.tar.gz otp-0908ef629325d2aed93f654ea78949205060a013.tar.bz2 otp-0908ef629325d2aed93f654ea78949205060a013.zip |
Update all post_*_per_* to also take the Config argument which the *_per_* was called with as an argument.
Diffstat (limited to 'lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests')
6 files changed, 94 insertions, 89 deletions
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl index 05f6563c45..d9aa1e77e4 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl @@ -38,17 +38,17 @@ -export([init/1]).
-export([pre_init_per_suite/3]).
--export([post_init_per_suite/3]).
+-export([post_init_per_suite/4]).
-export([pre_end_per_suite/3]).
--export([post_end_per_suite/3]).
+-export([post_end_per_suite/4]).
-export([pre_init_per_group/3]).
--export([post_init_per_group/3]).
+-export([post_init_per_group/4]).
-export([pre_end_per_group/3]).
--export([post_end_per_group/3]).
+-export([post_end_per_group/4]).
-export([pre_init_per_testcase/3]).
--export([post_end_per_testcase/3]).
+-export([post_end_per_testcase/4]).
-export([on_tc_fail/3]).
-export([on_tc_skip/3]).
@@ -95,22 +95,23 @@ pre_init_per_suite(Suite,Config,State) -> {Config, State}.
%% @doc Called after init_per_suite.
-%% you can change the config in this function.
+%% you can change the return value in this function.
-spec post_init_per_suite(Suite :: atom(),
- Config :: config(),
- State :: #state{}) ->
+ Config :: config(),
+ Return :: config() | skip_or_fail(),
+ State :: #state{}) ->
{config() | skip_or_fail(), NewState :: #state{}}.
-post_init_per_suite(Suite,Config,State) ->
+post_init_per_suite(Suite,Config,Return,State) ->
gen_event:notify(
?CT_EVMGR_REF, #event{ name = scb, node = node(),
data = {?MODULE, post_init_per_suite,
- [Suite,Config,State]}}),
- {Config, State}.
+ [Suite,Config,Return,State]}}),
+ {Return, State}.
-%% @doc Called before end_per_suite. Note that the config cannot be
-%% changed here, only the status of the suite.
+%% @doc Called before end_per_suite. The config/state can be changed here,
+%% though it will only affect the *end_per_suite function.
-spec pre_end_per_suite(Suite :: atom(),
- Config :: config(),
+ Config :: config() | skip_or_fail(),
State :: #state{}) ->
{ok | skip_or_fail(), NewState :: #state{}}.
pre_end_per_suite(Suite,Config,State) ->
@@ -123,15 +124,16 @@ pre_end_per_suite(Suite,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_per_suite(Suite :: atom(),
- Config :: config(),
- State :: #state{}) ->
+ Config :: config(),
+ Return :: term(),
+ State :: #state{}) ->
{ok | skip_or_fail(), NewState :: #state{}}.
-post_end_per_suite(Suite,Config,State) ->
+post_end_per_suite(Suite,Config,Return,State) ->
gen_event:notify(
?CT_EVMGR_REF, #event{ name = scb, node = node(),
data = {?MODULE, post_end_per_suite,
- [Suite,Config,State]}}),
- {Config, State}.
+ [Suite,Config,Return,State]}}),
+ {Return, State}.
%% @doc Called before each init_per_group.
%% You can change the config in this function.
@@ -147,23 +149,24 @@ pre_init_per_group(Group,Config,State) -> {Config, State}.
%% @doc Called after each init_per_group.
-%% You can change the config in this function.
+%% You can change the return value in this function.
-spec post_init_per_group(Group :: atom(),
- Config :: config(),
- State :: #state{}) ->
+ Config :: config(),
+ Return :: config() | skip_or_fail(),
+ State :: #state{}) ->
{config() | skip_or_fail(), NewState :: #state{}}.
-post_init_per_group(Group,Config,State) ->
+post_init_per_group(Group,Config,Return,State) ->
gen_event:notify(
?CT_EVMGR_REF, #event{ name = scb, node = node(),
data = {?MODULE, post_init_per_group,
- [Group,Config,State]}}),
- {Config, State}.
+ [Group,Config,Return,State]}}),
+ {Return, State}.
-%% @doc Called after each end_per_group. Note that the config cannot be
-%% changed here, only the status of the group.
+%% @doc Called after each end_per_group. The config/state can be changed here,
+%% though it will only affect the *end_per_group functions.
-spec pre_end_per_group(Group :: atom(),
- Config :: config(),
- State :: #state{}) ->
+ Config :: config() | skip_or_fail(),
+ State :: #state{}) ->
{ok | skip_or_fail(), NewState :: #state{}}.
pre_end_per_group(Group,Config,State) ->
gen_event:notify(
@@ -175,15 +178,16 @@ pre_end_per_group(Group,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_per_group(Group :: atom(),
- Config :: config(),
- State :: #state{}) ->
+ Config :: config(),
+ Return :: term(),
+ State :: #state{}) ->
{ok | skip_or_fail(), NewState :: #state{}}.
-post_end_per_group(Group,Config,State) ->
+post_end_per_group(Group,Config,Return,State) ->
gen_event:notify(
?CT_EVMGR_REF, #event{ name = scb, node = node(),
data = {?MODULE, post_end_per_group,
- [Group,Config,State]}}),
- {Config, State}.
+ [Group,Config,Return,State]}}),
+ {Return, State}.
%% @doc Called before each test case.
%% You can change the config in this function.
@@ -201,15 +205,16 @@ pre_init_per_testcase(TC,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_per_testcase(TC :: atom(),
- Config :: config(),
- State :: #state{}) ->
+ Config :: config(),
+ Return :: term(),
+ State :: #state{}) ->
{ok | skip_or_fail(), NewState :: #state{}}.
-post_end_per_testcase(TC,Config,State) ->
+post_end_per_testcase(TC,Config,Return,State) ->
gen_event:notify(
?CT_EVMGR_REF, #event{ name = scb, node = node(),
data = {?MODULE, post_end_per_testcase,
- [TC,Config,State]}}),
- {Config, State}.
+ [TC,Config,Return,State]}}),
+ {Return, State}.
%% @doc Called after post_init_per_suite, post_end_per_suite, post_init_per_group,
%% post_end_per_group and post_end_per_tc if the suite, group or test case failed.
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_suite_callback_SUITE_data/scb/tests/fail_post_suite_scb.erl index 2ba5013652..b3a3a5f94c 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_post_suite_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_post_suite_scb.erl @@ -34,33 +34,33 @@ init(Opts) -> pre_init_per_suite(Suite, Config, State) ->
empty_scb:pre_init_per_suite(Suite,Config,State).
-post_init_per_suite(Suite,Config,State) ->
- empty_scb:post_init_per_suite(Suite,Config,State),
+post_init_per_suite(Suite,Config,Return,State) ->
+ empty_scb: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).
-post_end_per_suite(Suite,Config,State) ->
- empty_scb:post_end_per_suite(Suite,Config,State).
+post_end_per_suite(Suite,Config,Return,State) ->
+ empty_scb:post_end_per_suite(Suite,Config,Return,State).
pre_init_per_group(Group,Config,State) ->
empty_scb:pre_init_per_group(Group,Config,State).
-post_init_per_group(Group,Config,State) ->
- empty_scb:post_init_per_group(Group,Config,State).
+post_init_per_group(Group,Config,Return,State) ->
+ empty_scb:post_init_per_group(Group,Config,Return,State).
pre_end_per_group(Group,Config,State) ->
empty_scb:pre_end_per_group(Group,Config,State).
-post_end_per_group(Group,Config,State) ->
- empty_scb:post_end_per_group(Group,Config,State).
+post_end_per_group(Group,Config,Return,State) ->
+ empty_scb:post_end_per_group(Group,Config,Return,State).
pre_init_per_testcase(TC,Config,State) ->
empty_scb:pre_init_per_testcase(TC,Config,State).
-post_end_per_testcase(TC,Config,State) ->
- empty_scb:post_end_per_testcase(TC,Config,State).
+post_end_per_testcase(TC,Config,Return,State) ->
+ empty_scb:post_end_per_testcase(TC,Config,Return,State).
on_tc_fail(TC, Reason, State) ->
empty_scb:on_tc_fail(TC,Reason,State).
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_suite_callback_SUITE_data/scb/tests/fail_pre_suite_scb.erl index f108624836..d49387ff8c 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_pre_suite_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_pre_suite_scb.erl @@ -35,32 +35,32 @@ pre_init_per_suite(Suite, Config, State) -> empty_scb:pre_init_per_suite(Suite,Config,State),
{{fail, "Test failure"}, State}.
-post_init_per_suite(Suite,Config,State) ->
- empty_scb:post_init_per_suite(Suite,Config,State).
+post_init_per_suite(Suite,Config,Return,State) ->
+ empty_scb:post_init_per_suite(Suite,Config,Return,State).
pre_end_per_suite(Suite,Config,State) ->
empty_scb:pre_end_per_suite(Suite,Config,State).
-post_end_per_suite(Suite,Config,State) ->
- empty_scb:post_end_per_suite(Suite,Config,State).
+post_end_per_suite(Suite,Config,Return,State) ->
+ empty_scb:post_end_per_suite(Suite,Config,Return,State).
pre_init_per_group(Group,Config,State) ->
empty_scb:pre_init_per_group(Group,Config,State).
-post_init_per_group(Group,Config,State) ->
- empty_scb:post_init_per_group(Group,Config,State).
+post_init_per_group(Group,Config,Return,State) ->
+ empty_scb:post_init_per_group(Group,Config,Return,State).
pre_end_per_group(Group,Config,State) ->
empty_scb:pre_end_per_group(Group,Config,State).
-post_end_per_group(Group,Config,State) ->
- empty_scb:post_end_per_group(Group,Config,State).
+post_end_per_group(Group,Config,Return,State) ->
+ empty_scb:post_end_per_group(Group,Config,Return,State).
pre_init_per_testcase(TC,Config,State) ->
empty_scb:pre_init_per_testcase(TC,Config,State).
-post_end_per_testcase(TC,Config,State) ->
- empty_scb:post_end_per_testcase(TC,Config,State).
+post_end_per_testcase(TC,Config,Return,State) ->
+ empty_scb:post_end_per_testcase(TC,Config,Return,State).
on_tc_fail(TC, Reason, State) ->
empty_scb:on_tc_fail(TC,Reason,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_suite_callback_SUITE_data/scb/tests/skip_post_suite_scb.erl index 5462e34175..a2e0578814 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_post_suite_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_post_suite_scb.erl @@ -34,33 +34,33 @@ init(Opts) -> pre_init_per_suite(Suite, Config, State) ->
empty_scb:pre_init_per_suite(Suite,Config,State).
-post_init_per_suite(Suite,Config,State) ->
- empty_scb:post_init_per_suite(Suite,Config,State),
+post_init_per_suite(Suite,Config,Return,State) ->
+ empty_scb: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).
-post_end_per_suite(Suite,Config,State) ->
- empty_scb:post_end_per_suite(Suite,Config,State).
+post_end_per_suite(Suite,Config,Return,State) ->
+ empty_scb:post_end_per_suite(Suite,Config,Return,State).
pre_init_per_group(Group,Config,State) ->
empty_scb:pre_init_per_group(Group,Config,State).
-post_init_per_group(Group,Config,State) ->
- empty_scb:post_init_per_group(Group,Config,State).
+post_init_per_group(Group,Config,Return,State) ->
+ empty_scb:post_init_per_group(Group,Config,Return,State).
pre_end_per_group(Group,Config,State) ->
empty_scb:pre_end_per_group(Group,Config,State).
-post_end_per_group(Group,Config,State) ->
- empty_scb:post_end_per_group(Group,Config,State).
+post_end_per_group(Group,Config,Return,State) ->
+ empty_scb:post_end_per_group(Group,Config,Return,State).
pre_init_per_testcase(TC,Config,State) ->
empty_scb:pre_init_per_testcase(TC,Config,State).
-post_end_per_testcase(TC,Config,State) ->
- empty_scb:post_end_per_testcase(TC,Config,State).
+post_end_per_testcase(TC,Config,Return,State) ->
+ empty_scb:post_end_per_testcase(TC,Config,Return,State).
on_tc_fail(TC, Reason, State) ->
empty_scb:on_tc_fail(TC,Reason,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_suite_callback_SUITE_data/scb/tests/skip_pre_suite_scb.erl index 006ae4a90f..4a0725ce2f 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_pre_suite_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_pre_suite_scb.erl @@ -36,32 +36,32 @@ pre_init_per_suite(Suite, Config, State) -> empty_scb:pre_init_per_suite(Suite,Config,State),
{{skip, "Test skip"}, State}.
-post_init_per_suite(Suite,Config,State) ->
- empty_scb:post_init_per_suite(Suite,Config,State).
+post_init_per_suite(Suite,Config,Return,State) ->
+ empty_scb:post_init_per_suite(Suite,Config,Return,State).
pre_end_per_suite(Suite,Config,State) ->
empty_scb:pre_end_per_suite(Suite,Config,State).
-post_end_per_suite(Suite,Config,State) ->
- empty_scb:post_end_per_suite(Suite,Config,State).
+post_end_per_suite(Suite,Config,Return,State) ->
+ empty_scb:post_end_per_suite(Suite,Config,Return,State).
pre_init_per_group(Group,Config,State) ->
empty_scb:pre_init_per_group(Group,Config,State).
-post_init_per_group(Group,Config,State) ->
- empty_scb:post_init_per_group(Group,Config,State).
+post_init_per_group(Group,Config,Return,State) ->
+ empty_scb:post_init_per_group(Group,Config,Return,State).
pre_end_per_group(Group,Config,State) ->
empty_scb:pre_end_per_group(Group,Config,State).
-post_end_per_group(Group,Config,State) ->
- empty_scb:post_end_per_group(Group,Config,State).
+post_end_per_group(Group,Config,Return,State) ->
+ empty_scb:post_end_per_group(Group,Config,Return,State).
pre_init_per_testcase(TC,Config,State) ->
empty_scb:pre_init_per_testcase(TC,Config,State).
-post_end_per_testcase(TC,Config,State) ->
- empty_scb:post_end_per_testcase(TC,Config,State).
+post_end_per_testcase(TC,Config,Return,State) ->
+ empty_scb:post_end_per_testcase(TC,Config,Return,State).
on_tc_fail(TC, Reason, State) ->
empty_scb:on_tc_fail(TC,Reason,State).
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl index 80d0f10415..9479f9d937 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl @@ -34,32 +34,32 @@ init(Opts) -> pre_init_per_suite(_Suite, _Config, _State) ->
lists:flaten([1,2,[3,4]]).
-post_init_per_suite(Suite,Config,State) ->
- empty_scb:post_init_per_suite(Suite,Config,State).
+post_init_per_suite(Suite,Config,Return,State) ->
+ empty_scb:post_init_per_suite(Suite,Config,Return,State).
pre_end_per_suite(Suite,Config,State) ->
empty_scb:pre_end_per_suite(Suite,Config,State).
-post_end_per_suite(Suite,Config,State) ->
- empty_scb:post_end_per_suite(Suite,Config,State).
+post_end_per_suite(Suite,Config,Return,State) ->
+ empty_scb:post_end_per_suite(Suite,Config,Return,State).
pre_init_per_group(Group,Config,State) ->
empty_scb:pre_init_per_group(Group,Config,State).
-post_init_per_group(Group,Config,State) ->
- empty_scb:post_init_per_group(Group,Config,State).
+post_init_per_group(Group,Config,Return,State) ->
+ empty_scb:post_init_per_group(Group,Config,Return,State).
pre_end_per_group(Group,Config,State) ->
empty_scb:pre_end_per_group(Group,Config,State).
-post_end_per_group(Group,Config,State) ->
- empty_scb:post_end_per_group(Group,Config,State).
+post_end_per_group(Group,Config,Return,State) ->
+ empty_scb:post_end_per_group(Group,Config,Return,State).
pre_init_per_testcase(TC,Config,State) ->
empty_scb:pre_init_per_testcase(TC,Config,State).
-post_end_per_testcase(TC,Config,State) ->
- empty_scb:post_end_per_testcase(TC,Config,State).
+post_end_per_testcase(TC,Config,Return,State) ->
+ empty_scb:post_end_per_testcase(TC,Config,Return,State).
on_tc_fail(TC, Reason, State) ->
empty_scb:on_tc_fail(TC,Reason,State).
|