From 68d7535fe0cccd50622884f704edeb9d8bb47430 Mon Sep 17 00:00:00 2001 From: tmanevik Date: Fri, 18 Dec 2015 12:21:32 +0100 Subject: Common Test: Editorial changes 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reference Manual files from Pär Wennstad added --- lib/common_test/doc/src/common_test_app.xml | 776 ++++++++++++++-------------- 1 file changed, 391 insertions(+), 385 deletions(-) (limited to 'lib/common_test/doc/src/common_test_app.xml') diff --git a/lib/common_test/doc/src/common_test_app.xml b/lib/common_test/doc/src/common_test_app.xml index cc554eb84e..10c93e2ed1 100644 --- a/lib/common_test/doc/src/common_test_app.xml +++ b/lib/common_test/doc/src/common_test_app.xml @@ -33,89 +33,84 @@ common_test_app.sgml common_test - A framework for automated testing of arbitrary target nodes + A framework for automated testing of any target nodes. -

The Common Test framework is an environment for +

The Common Test framework is an environment for implementing and performing automatic and semi-automatic execution of - test cases. + test cases.

- Common Test uses the OTP Test Server as engine for test case - execution and logging.

- -

In brief, Common Test supports:

+

In brief, Common Test supports:

- Automated execution of test suites (sets of test cases). - Logging of the events during execution. - HTML presentation of test suite results. - HTML presentation of test suite code. - Support functions for test suite authors. - Step by step execution of test cases. + Automated execution of test suites (sets of test cases) + Logging of events during execution + HTML presentation of test suite results + HTML presentation of test suite code + Support functions for test suite authors + Step-by-step execution of test cases - -

The following sections describe the mandatory and optional test suite - functions Common Test will call during test execution. For more details - see Common Test User's - Guide.

- + +

The following section describes the mandatory and optional test suite + functions that Common Test calls during test execution. + For more details, see section + Writing Test Suites + in the User's Guide.

+
- TEST CASE CALLBACK FUNCTIONS + Test Case Callback Functions

The following functions define the callback interface for a test suite.

- + Module:all() -> Tests | {skip,Reason} Returns the list of all test case groups and test cases in the module. - Tests = [TestCase | {group,GroupName} | - {group,GroupName,Properties} | - {group,GroupName,Properties,SubGroups}] + Tests = [TestCase | {group,GroupName} | {group,GroupName,Properties} | {group,GroupName,Properties,SubGroups}] TestCase = atom() GroupName = atom() - Properties = [parallel | sequence | Shuffle | {RepeatType,N}] | - default - SubGroups = [{GroupName,Properties} | - {GroupName,Properties,SubGroups}] + Properties = [parallel | sequence | Shuffle | {RepeatType,N}] | default + SubGroups = [{GroupName,Properties} | {GroupName,Properties,SubGroups}] Shuffle = shuffle | {shuffle,Seed} Seed = {integer(),integer(),integer()} - RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail | - repeat_until_any_ok | repeat_until_any_fail + RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail | repeat_until_any_ok | repeat_until_any_fail N = integer() | forever Reason = term() - + -

MANDATORY

- -

This function must return the list of all test cases and test - case groups in the test suite module that are to be executed. - This list also specifies the order the cases and groups will - be executed by Common Test. A test case is represented by an atom, +

MANDATORY

+ +

Returns the list of all test cases and test case groups in the + test suite module to be executed. This list also specifies the + order the cases and groups are executed by Common Test. + A test case is represented by an atom, the name of the test case function. A test case group is represented by a group tuple, where GroupName, - an atom, is the name of the group (defined in groups/0). - Execution properties for groups may also be specified, both - for a top level group and for any of its sub-groups. - Group execution properties specified here, will override - properties in the group definition (see groups/0). + an atom, is the name of the group (defined in + groups/0). + Execution properties for groups can also be specified, both + for a top-level group and for any of its subgroups. + Group execution properties specified here override + properties in the group definition (see + groups/0). (With value default, the group definition properties - will be used).

- -

If {skip,Reason} is returned, all test cases - in the module will be skipped, and the Reason will - be printed on the HTML result page.

- -

For details on groups, see - Test case - groups in the User's Guide.

- + are used).

+ +

If {skip,Reason} is returned, all test cases + in the module are skipped and Reason + is printed on the HTML result page.

+ +

For details on groups, see section + Test Case + Groups in the User's Guide.

+
@@ -123,25 +118,24 @@ Module:groups() -> GroupDefs Returns a list of test case group definitions. - GroupDefs = [Group] - Group = {GroupName,Properties,GroupsAndTestCases} - GroupName = atom() - Properties = [parallel | sequence | Shuffle | {RepeatType,N}] - GroupsAndTestCases = [Group | {group,GroupName} | TestCase] - TestCase = atom() - Shuffle = shuffle | {shuffle,Seed} - Seed = {integer(),integer(),integer()} - RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail | - repeat_until_any_ok | repeat_until_any_fail - N = integer() | forever + GroupDefs = [Group] + Group = {GroupName,Properties,GroupsAndTestCases} + GroupName = atom() + Properties = [parallel | sequence | Shuffle | {RepeatType,N}] + GroupsAndTestCases = [Group | {group,GroupName} | TestCase] + TestCase = atom() + Shuffle = shuffle | {shuffle,Seed} + Seed = {integer(),integer(),integer()} + RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail | repeat_until_any_ok | repeat_until_any_fail + N = integer() | forever - + -

OPTIONAL

- -

Function for defining test case groups. Please see - Test case - groups in the User's Guide for details.

+

OPTIONAL

+ +

Defines test case groups. For details, see section + Test Case + Groups in the User's Guide.

@@ -150,75 +144,71 @@ Test suite info function (providing default data for the suite). - Info = {timetrap,Time} | {require,Required} | - {require,Name,Required} | {userdata,UserData} | - {silent_connections,Conns} | {stylesheet,CSSFile} | - {ct_hooks, CTHs} - Time = TimeVal | TimeFunc - TimeVal = MilliSec | {seconds,integer()} | {minutes,integer()} | - {hours,integer()} - TimeFunc = {Mod,Func,Args} | Fun - MilliSec = integer() - Mod = atom() - Func = atom() - Args = list() - Fun = fun() - Required = Key | {Key,SubKeys} | {Key,SubKey} | {Key,SubKey,SubKeys} - Key = atom() - SubKeys = SubKey | [SubKey] - SubKey = atom() - Name = atom() - UserData = term() - Conns = [atom()] - CSSFile = string() - CTHs = [CTHModule | -         {CTHModule, CTHInitArgs} | -         {CTHModule, CTHInitArgs, CTHPriority}] - CTHModule = atom() - CTHInitArgs = term() + Info = {timetrap,Time} | {require,Required} | {require,Name,Required} | {userdata,UserData} | {silent_connections,Conns} | {stylesheet,CSSFile} | {ct_hooks, CTHs} + Time = TimeVal | TimeFunc + TimeVal = MilliSec | {seconds,integer()} | {minutes,integer()} | {hours,integer()} + TimeFunc = {Mod,Func,Args} | Fun + MilliSec = integer() + Mod = atom() + Func = atom() + Args = list() + Fun = fun() + Required = Key | {Key,SubKeys} | {Key,SubKey} | {Key,SubKey,SubKeys} + Key = atom() + SubKeys = SubKey | [SubKey] + SubKey = atom() + Name = atom() + UserData = term() + Conns = [atom()] + CSSFile = string() + CTHs = [CTHModule | +         {CTHModule, CTHInitArgs} | +         {CTHModule, CTHInitArgs, CTHPriority}] + CTHModule = atom() + CTHInitArgs = term() - -

OPTIONAL

- -

This is the test suite info function. It is supposed to - return a list of tagged tuples that specify various properties - related to the execution of this test suite (common for all - test cases in the suite).

- -

The timetrap tag sets the maximum time each - test case is allowed to execute (including init_per_testcase/2 - and end_per_testcase/2). If the timetrap time is - exceeded, the test case fails with reason + +

OPTIONAL

+ +

The test suite information function. Returns a list of tagged + tuples specifying various properties related to the execution of + this test suite (common for all test cases in the suite).

+ +

Tag timetrap sets the maximum time that each + test case is allowed to execute (including + init_per_testcase/2 + and + end_per_testcase/2). + If the timetrap time is exceeded, the test case fails with reason timetrap_timeout. A TimeFunc function can be used to - set a new timetrap by returning a TimeVal. It may also be - used to trigger a timetrap timeout by, at some point, returning a - value other than a TimeVal. (See the - User's Guide - for details). -

- -

The require tag specifies configuration variables - that are required by test cases (and/or configuration functions) + set a new timetrap by returning a TimeVal. It can also be + used to trigger a timetrap time-out by, at some point, returning a + value other than a TimeVal. For details, see section + Timetrap Time-Outs + in the User's Guide.

+ +

Tag require specifies configuration variables + required by test cases (or configuration functions) in the suite. If the required configuration variables are not found - in any of the configuration files, all test cases are skipped. For more - information about the 'require' functionality, see the - reference manual for the function - ct:require/1/2.

+ in any of the configuration files, all test cases are skipped. + For details about the require functionality, see funtion + ct:require/1,2.

-

With userdata, it is possible for the user to - specify arbitrary test suite related information which can be - read by calling ct:userdata/2.

+

With userdata, the user can + specify any test suite-related information, which can be + read by calling + ct:userdata/2.

-

The ct_hooks tag specifies which +

Tag ct_hooks specifies the Common Test Hooks - are to be run together with this suite.

- -

Other tuples than the ones defined will simply be ignored.

+ to be run with this suite.

-

For more information about the test suite info function, - see Test - suite info function in the User's Guide.

+

Other tuples than the ones defined are ignored.

+ +

For details about the test suite information function, see section + Test + Suite Information Function in the User's Guide.

@@ -227,129 +217,133 @@ {skip_and_save,Reason,SaveConfig} Test suite initializations. - Config = NewConfig = SaveConfig = [{Key,Value}] - Key = atom() - Value = term() - Reason = term() + Config = NewConfig = SaveConfig = [{Key,Value}] + Key = atom() + Value = term() + Reason = term() - -

OPTIONAL

- + +

OPTIONAL

+

This configuration function is called as the first function in the - suite. It typically contains initializations which are common for - all test cases in the suite, and which shall only be done - once. The Config parameter is the configuration data - which can be modified here. Whatever is returned from this - function is given as Config to all configuration functions - and test cases in the suite. If {skip,Reason} - is returned, all test cases in the suite will be skipped - and Reason printed in the overview log for the suite.

-

For information on save_config and skip_and_save, - please see - Dependencies - between Test Cases and Suites in the User's Guide.

-
+ suite. It typically contains initializations that are common for + all test cases in the suite, and that must only be done + once. Parameter Config is the configuration data + that can be modified. Whatever is returned from this + function is specified 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.

+ +

For information on save_config and skip_and_save, + see section + Saving + Configuration Data in the User's Guide.

+ - + Module:end_per_suite(Config) -> term() | {save_config,SaveConfig} - Test suite finalization. + Test suite finalization. - Config = SaveConfig = [{Key,Value}] - Key = atom() - Value = term() + Config = SaveConfig = [{Key,Value}] + Key = atom() + Value = term() - + -

OPTIONAL

+

OPTIONAL

This function is called as the last test case in the suite. It is meant to be used for cleaning up after - init_per_suite/1. - For information on save_config, please see - Dependencies - between Test Cases and Suites in the User's Guide.

+ init_per_suite/1.

+

For information on save_config, see section + Saving + Configuration Data in the User's Guide.

Module:group(GroupName) -> [Info] - Test case group info function (providing default data - for a test case group, i.e. its test cases and sub-groups). + Test case group information function (providing default data + for a test case group, that is, its test cases and + subgroups). - Info = {timetrap,Time} | {require,Required} | - {require,Name,Required} | {userdata,UserData} | - {silent_connections,Conns} | {stylesheet,CSSFile} | - {ct_hooks, CTHs} - Time = TimeVal | TimeFunc - TimeVal = MilliSec | {seconds,integer()} | {minutes,integer()} | - {hours,integer()} - TimeFunc = {Mod,Func,Args} | Fun - MilliSec = integer() - Mod = atom() - Func = atom() - Args = list() - Fun = fun() - Required = Key | {Key,SubKeys} | {Key,Subkey} | {Key,Subkey,SubKeys} - Key = atom() - SubKeys = SubKey | [SubKey] - SubKey = atom() - Name = atom() - UserData = term() - Conns = [atom()] - CSSFile = string() - CTHs = [CTHModule | -         {CTHModule, CTHInitArgs} | -         {CTHModule, CTHInitArgs, CTHPriority}] - CTHModule = atom() - CTHInitArgs = term() - - - -

OPTIONAL

- -

This is the test case group info function. It is supposed to + Info = {timetrap,Time} | {require,Required} | {require,Name,Required} | {userdata,UserData} | {silent_connections,Conns} | {stylesheet,CSSFile} | {ct_hooks, CTHs} + Time = TimeVal | TimeFunc + TimeVal = MilliSec | {seconds,integer()} | {minutes,integer()} | {hours,integer()} + TimeFunc = {Mod,Func,Args} | Fun + MilliSec = integer() + Mod = atom() + Func = atom() + Args = list() + Fun = fun() + Required = Key | {Key,SubKeys} | {Key,Subkey} | {Key,Subkey,SubKeys} + Key = atom() + SubKeys = SubKey | [SubKey] + SubKey = atom() + Name = atom() + UserData = term() + Conns = [atom()] + CSSFile = string() + CTHs = [CTHModule | +         {CTHModule, CTHInitArgs} | +         {CTHModule, CTHInitArgs, CTHPriority}] + CTHModule = atom() + CTHInitArgs = term() + + + +

OPTIONAL

+ +

The test case group information function. It is supposed to return a list of tagged tuples that specify various properties - related to the execution of a test case group (i.e. its test cases - and sub-groups). Properties set by + related to the execution of a test case group (that is, its test + cases and subgroups). Properties set by group/1 override - properties with the same key that have been previously set by + properties with the same key that have been set previously by suite/0.

-

The timetrap tag sets the maximum time each - test case is allowed to execute (including init_per_testcase/2 - and end_per_testcase/2). If the timetrap time is +

Tag timetrap sets the maximum time that each + test case is allowed to execute (including + init_per_testcase/2 + and + end_per_testcase/2). + If the timetrap time is exceeded, the test case fails with reason timetrap_timeout. A TimeFunc function can be used to - set a new timetrap by returning a TimeVal. It may also be - used to trigger a timetrap timeout by, at some point, returning a - value other than a TimeVal. (See the - User's Guide - for details).

+ set a new timetrap by returning a TimeVal. It can also be + used to trigger a timetrap time-out by, at some point, returning a + value other than a TimeVal. For details, see section + Timetrap + Time-Outs in the User's Guide.

-

The require tag specifies configuration variables - that are required by test cases (and/or configuration functions) +

Tag require specifies configuration variables + required by test cases (or configuration functions) in the suite. If the required configuration variables are not found - in any of the configuration files, all test cases in this group are skipped. - For more information about the 'require' functionality, see the - reference manual for the function - ct:require/1/2.

+ in any of the configuration files, all test cases in this group are + skipped. For details about the require functionality, see + function + ct:require/1,2.

-

With userdata, it is possible for the user to - specify arbitrary test case group related information which can be - read by calling ct:userdata/2.

+

With userdata, the user can + specify any test case group related information that can be + read by calling + ct:userdata/2.

-

The ct_hooks tag specifies which +

Tag ct_hooks specifies the Common Test Hooks - are to be run together with this suite.

- -

Other tuples than the ones defined will simply be ignored.

+ to be run with this suite.

-

For more information about the test case group info function, - see Test - case group info function in the User's Guide.

+

Other tuples than the ones defined are ignored.

+ +

For details about the test case group information function, + see section Group + Information Function in the User's Guide.

@@ -358,59 +352,66 @@ {skip,Reason} Test case group initializations. - GroupName = atom() - Config = NewConfig = [{Key,Value}] - Key = atom() - Value = term() - Reason = term() + GroupName = atom() + Config = NewConfig = [{Key,Value}] + Key = atom() + Value = term() + Reason = term() - -

OPTIONAL

- + +

OPTIONAL

+

This configuration function is called before execution of a - test case group. It typically contains initializations which are - common for all test cases and sub-groups in the group, and which - shall only be performed once. GroupName is the name of the - group, as specified in the group definition (see groups/0). The - Config parameter is the configuration data which can be modified - here. The return value of this function is given as Config - to all test cases and sub-groups in the group. If {skip,Reason} - is returned, all test cases in the group will be skipped and - Reason printed in the overview log for the group.

- -

For information about test case groups, please see - Test case - groups chapter in the User's Guide.

+ test case group. It typically contains initializations that are + common for all test cases and subgroups in the group, and that + must only be performed once. GroupName is the name of the + group, as specified in the group definition (see + groups/0). + Parameter Config is the configuration data that can be + modified. + The return value of this function is given as Config + to 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.

+ +

For information about test case groups, see section + Test Case + Groups in the User's Guide.

- + Module:end_per_group(GroupName, Config) -> term() | {return_group_result,Status} Test case group finalization. - GroupName = atom() - Config = [{Key,Value}] - Key = atom() - Value = term() - Status = ok | skipped | failed + GroupName = atom() + Config = [{Key,Value}] + Key = atom() + Value = term() + Status = ok | skipped | failed - + -

OPTIONAL

- -

This function is called after the execution of a test case group is finished. - It is meant to be used for cleaning up after init_per_group/2. - By means of {return_group_result,Status}, it is possible to return a - status value for a nested sub-group. The status can be retrieved in - end_per_group/2 for the group on the level above. The status will also - be used by Common Test for deciding if execution of a group should proceed in - case the property sequence or repeat_until_* is set.

- -

For more information about test case groups, please see - Test case - groups chapter in the User's Guide.

+

OPTIONAL

+ +

This function is called after the execution of a test case group + is finished. It is meant to be used for cleaning up after + init_per_group/2. + A status value for a nested subgroup can be returned with + {return_group_result,Status}. The status can be retrieved in + end_per_group/2 + for the group on the level above. The status is also used by + Common Test for deciding if execution of a group is to + proceed if property sequence or repeat_until_* + is set.

+ +

For details about test case groups, see section + Test Case + Groups in the User's Guide.

@@ -424,168 +425,173 @@ Value = term() Reason = term() - - + +

OPTIONAL

- -

This function is called before each test case. The - TestCase argument is the name of the test case, and + +

This function is called before each test case. Argument + TestCase is the test case name, and Config (list of key-value tuples) is the configuration - data that can be modified here. The NewConfig list returned + data that can be modified. The NewConfig list returned from this function is given as Config to the test case. If {fail,Reason} is returned, the test case is - marked as failed without being executed. If {skip,Reason} is - returned, the test case will be skipped and Reason printed - in the overview log for the suite.

+ marked as failed without being executed.

+ +

If {skip,Reason} is returned, the test case is skipped + and Reason is printed in the overview log for the suite.

- + Module:end_per_testcase(TestCase, Config) -> term() | {fail,Reason} | {save_config,SaveConfig} Test case finalization. - TestCase = atom() - Config = SaveConfig = [{Key,Value}] - Key = atom() - Value = term() - Reason = term() + TestCase = atom() + Config = SaveConfig = [{Key,Value}] + Key = atom() + Value = term() + Reason = term() - -

OPTIONAL

- -

This function is called after each test case, and can be used - to clean up after init_per_testcase/2 and the test case. - Any return value (besides {fail,Reason} and {save_config,SaveConfig}) - is ignored. By returning {fail,Reason}, TestCase will be marked as - failed (even though it was actually successful in the sense that it returned - a value instead of terminating). For information on save_config, please see - Dependencies between - Test Cases and Suites in the User's Guide

+ +

OPTIONAL

+ +

This function is called after each test case, and can be used + to clean up after + init_per_testcase/2 + and the test case. Any return value (besides {fail,Reason} + and {save_config,SaveConfig}) is ignored. By returning + {fail,Reason}, TestCase is marked as faulty (even + though it was successful in the sense that it returned + a value instead of terminating).

+ +

For information on save_config, see section + Saving + Configuration Data in the User's Guide.

- + Module:Testcase() -> [Info] - Test case info function. + Test case information function. - Info = {timetrap,Time} | {require,Required} | - {require,Name,Required} | {userdata,UserData} | - {silent_connections,Conns} - Time = TimeVal | TimeFunc - TimeVal = MilliSec | {seconds,integer()} | {minutes,integer()} | - {hours,integer()} - TimeFunc = {Mod,Func,Args} | Fun - MilliSec = integer() - Mod = atom() - Func = atom() - Args = list() - Fun = fun() - Required = Key | {Key,SubKeys} | {Key,Subkey} | {Key,Subkey,SubKeys} - Key = atom() - SubKeys = SubKey | [SubKey] - SubKey = atom() - Name = atom() - UserData = term() - Conns = [atom()] + Info = {timetrap,Time} | {require,Required} | {require,Name,Required} | {userdata,UserData} | {silent_connections,Conns} + Time = TimeVal | TimeFunc + TimeVal = MilliSec | {seconds,integer()} | {minutes,integer()} | {hours,integer()} + TimeFunc = {Mod,Func,Args} | Fun + MilliSec = integer() + Mod = atom() + Func = atom() + Args = list() + Fun = fun() + Required = Key | {Key,SubKeys} | {Key,Subkey} | {Key,Subkey,SubKeys} + Key = atom() + SubKeys = SubKey | [SubKey] + SubKey = atom() + Name = atom() + UserData = term() + Conns = [atom()] - - + +

OPTIONAL

- -

This is the test case info function. It is supposed to + +

The test case information function. It is supposed to return a list of tagged tuples that specify various properties related to the execution of this particular test case. - Properties set by Testcase/0 override - properties that have been previously set for the test case - by group/1 or suite/0.

- -

The timetrap tag sets the maximum time the + Properties set by + Testcase/0 + override properties set previously for the test case by + group/1 or + suite/0.

+ +

Tag timetrap sets the maximum time that the test case is allowed to execute. If the timetrap time is - exceeded, the test case fails with reason - timetrap_timeout. init_per_testcase/2 - and end_per_testcase/2 are included in the - timetrap time. A TimeFunc function can be used to - set a new timetrap by returning a TimeVal. It may also be - used to trigger a timetrap timeout by, at some point, returning a - value other than a TimeVal. (See the - User's Guide - for details).

+ exceeded, the test case fails with reason timetrap_timeout. + init_per_testcase/2 + and + end_per_testcase/2 + are included in the timetrap time. + A TimeFunc function can be used to + set a new timetrap by returning a TimeVal. It can also be + used to trigger a timetrap time-out by, at some point, returning a + value other than a TimeVal. For details, see section + Timetrap + Time-Outs in the User's Guide.

-

The require tag specifies configuration variables - that are required by the test case (and/or init/end_per_testcase/2). +

Tag require specifies configuration variables + that are required by the test case (or init_per_testcase/2 + or end_per_testcase/2). If the required configuration variables are not found in any of the - configuration files, the test case is skipped. For more - information about the 'require' functionality, see the - reference manual for the function - ct:require/1/2.

- -

If timetrap and/or require is not set, the - default values specified by suite/0 (or - group/1) will be used.

- -

With userdata, it is possible for the user to - specify arbitrary test case related information which can be - read by calling ct:userdata/3.

- -

Other tuples than the ones defined will simply be ignored.

+ configuration files, the test case is skipped. For details about + the require functionality, see function + ct:require/1,2.

+ +

If timetrap or require is not set, the + default values specified by + suite/0 (or + group/1) are used.

+ +

With userdata, the user can specify any test case-related + information that can be read by calling + ct:userdata/3.

+ +

Other tuples than the ones defined are ignored.

-

For more information about the test case info function, - see Test - case info function in the User's Guide.

+

For details about the test case information function, see section + Test + Case Information Function in the User's Guide.

- - + Module:Testcase(Config) -> term() | {skip,Reason} | {comment,Comment} | {save_config,SaveConfig} | {skip_and_save,Reason,SaveConfig} | exit() - A test case + A test case. - Config = SaveConfig = [{Key,Value}] - Key = atom() - Value = term() - Reason = term() - Comment = string() + Config = SaveConfig = [{Key,Value}] + Key = atom() + Value = term() + Reason = term() + Comment = string() - + -

MANDATORY

- -

This is the implementation of a test case. Here you must - call the functions you want to test, and do whatever you - need to check the result. If something fails, make sure the - function causes a runtime error, or call ct:fail/1/2 +

MANDATORY

+ +

The implementation of a test case. Call the functions to test and + check the result. If something fails, ensure the + function causes a runtime error or call + ct:fail/1,2 (which also causes the test case process to terminate).

- -

Elements from the Config list can e.g. be read - with proplists:get_value/2 (or the macro ?config - defined in ct.hrl).

-

You can return {skip,Reason} if you decide not to - run the test case after all. Reason will then be - printed in 'Comment' field on the HTML result page.

- -

You can return {comment,Comment} if you wish to - print some information in the 'Comment' field on the HTML - result page.

- -

If the function returns anything else, the test case is - considered successful. (The return value always gets printed - in the test case log file).

+

Elements from the Config list can, for example, be read + with proplists:get_value/2 in STDLIB + (or the macro ?config defined in ct.hrl).

+ +

If you decide not to run the test case after all, return + {skip,Reason}. Reason is then + printed in field Comment on the HTML result page.

+ +

To print some information in field Comment on the HTML + result page, return {comment,Comment}.

-

For more information about test case implementation, please - see Test - cases in the User's Guide.

+

If the function returns anything else, the test case is + considered successful. The return value always gets printed + in the test case log file.

-

For information on save_config and skip_and_save, please see - Dependencies between - Test Cases and Suites in the User's Guide.

+

For details about test case implementation, see section + Test Cases + in the User's Guide.

+ +

For information on save_config and skip_and_save, + see section + Saving + Configuration Data in the User's Guide.

- +
- -- cgit v1.2.3