The Common Test Hook (CTH) framework allows extensions of the
default behavior of
In brief, CTH allows you to:
Manipulate the runtime configuration before each suite configuration call.
Manipulate the return of all suite configuration calls and by extension the result of the test themselves.
The following sections describe the mandatory and optional CTH
functions that
For information about how to add a CTH to your suite, see section
For a minimal example of a CTH, see section
The following functions define the callback interface for a CTH.
MANDATORY
This function is always called before any other callback function. Use it to initiate any common state. It is to return a state for this CTH.
For details about when
OPTIONAL
This function is called after
This function is called only if the CTH is added before
Notice that for CTHs that are installed by means of the
Prior to each test execution, Common Test does a
simulated test run in order to count test suites, groups
and cases for logging purposes. This causes
the
OPTIONAL
This function is called after
This function is called only if the CTH is added before
Notice that for CTHs that are installed by means of the
Prior to each test execution, Common Test does a
simulated test run in order to count test suites, groups
and cases for logging purposes. This causes
the
OPTIONAL
This function is called before
This function is called only if the CTH is added before
OPTIONAL
This function is called after
This function is called only if the CTH is added before or in
OPTIONAL
This function is called before
If
OPTIONAL
This function is called after
If
OPTIONAL
This function is called before
If
CTHs cannot be added here right now. That feature may be added in a later release, but it would right now break backwards compatibility.
OPTIONAL
This function is called after
If
OPTIONAL
This function is called before
This function cannot change the result of the test case by returning skip or fail
tuples, but it may insert items in
If
OPTIONAL
This function is called after
If
OPTIONAL
This function is called before
If
OPTIONAL
This function is called after
If
OPTIONAL
This function is called before
OPTIONAL
This function is called after
OPTIONAL
This function is called whenever a test case (or configuration function) fails. It is called after the post function is called for the failed test case, that is:
If
If a test case fails, this funcion is called after
If the failed test case belongs to a test case group, the first
argument is a tuple
The data that comes with
If
OPTIONAL
This function is called whenever a test case (or configuration function) is skipped. It is called after the post function is called for the skipped test case, that is:
If
If a test case is skipped, this function is called after
If the skipped test case belongs to a test case group, the first
argument is a tuple
The data that comes with
If
OPTIONAL
This function is called at the end of a CTH
OPTIONAL
The
This function is not to have any side effects, as it can
be called multiple times by
If not implemented, the CTH acts as if this function returned a call
to