The Common Test Hook (henceforth called CTH) framework allows extensions of the default behaviour of Common Test by means of callbacks before and after all test suite calls. It is meant for advanced users of Common Test which want to abstract out behaviour which is common to multiple test suites.
In brief, Common Test Hooks allows you to:
The following sections describe the mandatory and optional CTH
functions Common Test will call during test execution. For more details
see
For information about how to add a CTH to your suite see
See the
The following functions define the callback interface for a Common Test Hook.
MANDATORY
Always called before any other callback function. Use this to initiate any common state. It should return a state for this CTH.
For details about when init is called see
OPTIONAL
This function is called before
Note that this function is only called if the CTH has been added
before init_per_suite is run, see
OPTIONAL
This function is called after
Note that this function is only called if the CTH has been added
before or in init_per_suite, see
OPTIONAL
This function is called before
OPTIONAL
This function is called after
OPTIONAL
This function is called before
Note that it is not possible to add CTH's here right now, that feature might be added later, but it would right now break backwards compatibility.
OPTIONAL
This function is called after
OPTIONAL
This function is called before
OPTIONAL
This function is called after
OPTIONAL
This function is called before
OPTIONAL
This function is called after
OPTIONAL
This function is called whenever a testcase fails.
It is called after the post function has been called for
the testcase which failed. i.e.
if init_per_suite fails this function is called after
The data which comes with the Reason follows the same format as the
OPTIONAL
This function is called whenever a testcase is skipped.
It is called after the post function has been called for the
testcase which was skipped.
i.e. if init_per_group is skipped this function is called after
The data which comes with the Reason follows the same format as
OPTIONAL
This function is called at the end of a CTH's
OPTIONAL
The
This function should NOT have any side effects as it might be called multiple times by Common Test.
If not implemented the CTH will act as if this function returned a
call to