Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions lib/common_test/doc/guides/example_chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,13 @@ suite() ->

%%--------------------------------------------------------------------
%% Function: init_per_suite(Config0) ->
%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
%% Config1 | {skip,Reason} | {fail,Reason} |
%% {skip_and_save,Reason,Config1}
%%
%% Config0 = Config1 = [tuple()]
%% A list of key/value pairs, holding the test case configuration.
%% Reason = term()
%% The reason for skipping the suite.
%% The reason for skipping or failing the suite.
%%
%% Description: Initialization before the suite.
%%
Expand All @@ -227,14 +228,16 @@ end_per_suite(_Config) ->

%%--------------------------------------------------------------------
%% Function: init_per_group(GroupName, Config0) ->
%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
%% Config1 | {skip,Reason} | {fail,Reason} |
%% {skip_and_save,Reason,Config1}
%%
%% GroupName = atom()
%% Name of the test case group that is about to run.
%% Config0 = Config1 = [tuple()]
%% A list of key/value pairs, holding configuration data for the group.
%% Reason = term()
%% The reason for skipping all test cases and subgroups in the group.
%% The reason for skipping or failing all test cases and subgroups
%% in the group.
%%
%% Description: Initialization before each test case group.
%%--------------------------------------------------------------------
Expand Down Expand Up @@ -396,7 +399,8 @@ suite() ->

%%--------------------------------------------------------------------
%% Function: init_per_suite(Config0) ->
%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
%% Config1 | {skip,Reason} | {fail,Reason} |
%% {skip_and_save,Reason,Config1}
%% Config0 = Config1 = [tuple()]
%% Reason = term()
%%--------------------------------------------------------------------
Expand All @@ -412,7 +416,8 @@ end_per_suite(_Config) ->

%%--------------------------------------------------------------------
%% Function: init_per_group(GroupName, Config0) ->
%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
%% Config1 | {skip,Reason} | {fail,Reason} |
%% {skip_and_save,Reason,Config1}
%% GroupName = atom()
%% Config0 = Config1 = [tuple()]
%% Reason = term()
Expand Down
8 changes: 8 additions & 0 deletions lib/common_test/src/ct_suite.erl
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ as `Config` to all configuration functions and test cases in the suite.
If `{skip, Reason}` is returned, all test cases in the suite are skipped and
`Reason` is printed in the overview log for the suite.

If `{fail, Reason}` is returned, suite initialization is marked as failed and
all test cases in the suite are skipped.

For information on `save_config` and `skip_and_save`, see section
[Saving Configuration Data](dependencies_chapter.md#save_config) in the User's
Guide.
Expand All @@ -201,6 +204,7 @@ If this function is defined, then
""".
-callback init_per_suite(Config :: ct_config()) ->
NewConfig :: ct_config() |
{fail, Reason :: term()} |
{skip, Reason :: term()} |
{skip_and_save, Reason :: term(), SaveConfig :: ct_config()}.

Expand Down Expand Up @@ -270,6 +274,9 @@ all test cases and subgroups in the group.
If `{skip, Reason}` is returned, all test cases in the group are skipped and
`Reason` is printed in the overview log for the group.

If `{fail, Reason}` is returned, group initialization is marked as failed and
all test cases and subgroups in the group are skipped.

For information about test case groups, see section
[Test Case Groups](write_test_chapter.md#test_case_groups) in the User's Guide.

Expand All @@ -278,6 +285,7 @@ If this function is defined, then
""".
-callback init_per_group(GroupName :: ct_groupname(), Config :: ct_config()) ->
NewConfig :: ct_config() |
{fail, Reason :: term()} |
{skip, Reason :: term()}.

-doc """
Expand Down
Loading