diff options
author | Erlang/OTP <[email protected]> | 2019-04-16 16:37:34 +0200 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2019-04-16 16:37:34 +0200 |
commit | 4351793954bc554c95a91d659e3f472b8b98d16c (patch) | |
tree | 69cdb803a96ac05ae19b970f07cb47bb3e86346f /lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl | |
parent | cdcc5e2d74691d6a070f957afc7f6cb8b7141dd2 (diff) | |
parent | 54e599a8be99fe41b45c913b59277dd6e3189e27 (diff) | |
download | otp-4351793954bc554c95a91d659e3f472b8b98d16c.tar.gz otp-4351793954bc554c95a91d659e3f472b8b98d16c.tar.bz2 otp-4351793954bc554c95a91d659e3f472b8b98d16c.zip |
Merge branch 'siri/ct/fuzzer_support/ERIERL-143/OTP-14746' into maint-20
* siri/ct/fuzzer_support/ERIERL-143/OTP-14746:
[ct] Fix bug with faulty suite name in end_per_suite config
[ct] Add {testcase,TC,RepeatProps} syntax for repeating test cases
[ct] Add post_groups/2 and post_all/3 hook functions
# Conflicts:
# lib/common_test/test/Makefile
Diffstat (limited to 'lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl')
-rw-r--r-- | lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl index 961ea68d2d..324f1dc80a 100644 --- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl @@ -39,6 +39,9 @@ -export([id/1]). -export([init/2]). +-export([post_all/3]). +-export([post_groups/2]). + -export([pre_init_per_suite/3]). -export([post_init_per_suite/4]). -export([pre_end_per_suite/3]). @@ -71,6 +74,31 @@ -record(state, { id = ?MODULE :: term()}). +%% @doc Called after groups/0. +%% you can change the return value in this function. +-spec post_groups(Suite :: atom(), Groups :: list()) -> list(). +post_groups(Suite,Groups) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = cth, node = node(), + data = {?MODULE, post_groups, + [Suite,Groups]}}), + ct:log("~w:post_groups(~w) called", [?MODULE,Suite]), + Groups. + +%% @doc Called after all/0. +%% you can change the return value in this function. +-spec post_all(Suite :: atom(), + Tests :: list(), + Groups :: term()) -> + list(). +post_all(Suite,Tests,Groups) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = cth, node = node(), + data = {?MODULE, post_all, + [Suite,Tests,Groups]}}), + ct:log("~w:post_all(~w) called", [?MODULE,Suite]), + Tests. + %% @doc Always called before any other callback function. Use this to initiate %% any common state. It should return an state for this CTH. -spec init(Id :: term(), Opts :: proplists:proplist()) -> |