The Common Test framework is an environment for implementing and performing automatic and semi-automatic execution of test cases. Common Test uses the OTP Test Server as engine for test case execution and logging.
In brief, Common Test supports:
The following sections describe the mandatory and optional test suite
functions Common Test will call during test execution. For more details
see
The following functions define the callback interface for a test suite.
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,
the name of the test case function. A test case group is
represented by a
If
For details on groups, see
OPTIONAL
Function for defining test case groups. Please see
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
The
With
The
Other tuples than the ones defined will simply be ignored.
For more information about the test suite info function,
see
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
For information on
OPTIONAL
This function is called as the last test case in the
suite. It is meant to be used for cleaning up after
OPTIONAL
This is the test case group info 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
The
The
With
The
Other tuples than the ones defined will simply be ignored.
For more information about the test case group info function,
see
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.
For information about test case groups, please see
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
For more information about test case groups, please see
OPTIONAL
This function is called before each test case. The
OPTIONAL
This function is called after each test case, and can be used
to clean up after
OPTIONAL
This is the test case info 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
The
The
If
With
Other tuples than the ones defined will simply be ignored.
For more information about the test case info function,
see
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
Elements from the
You can return
You can return
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 more information about test case implementation, please
see
For information on