From 68d7535fe0cccd50622884f704edeb9d8bb47430 Mon Sep 17 00:00:00 2001
From: tmanevik 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. The Common Test Hook (CTH) framework allows extensions of the
+ default behavior of In brief, Common Test Hooks allows you to: 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 Common Test will call during test execution. For more details
- see
-
+
For information about how to add a CTH to your suite see
-
For information about how to add a CTH to your suite, see section
+
For a minimal example of a CTH, see section
+
See the
-
The following functions define the callback interface - for a Common Test Hook.
+The following functions define the callback interface for a CTH.
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
-
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 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 before
+
This function is called only if the CTH is added before
+
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 after
+
This function is called only if the CTH is added before or in
+
OPTIONAL
- -This function is called before
-
OPTIONAL
+ +This function is called before
+
OPTIONAL
- -This function is called after
-
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 before
+
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
-
OPTIONAL
+ +This function is called after
+
OPTIONAL
- -This function is called before
-
OPTIONAL
+ +This function is called before
+
OPTIONAL
- -This function is called after
-
OPTIONAL
+ +This function is called after
+
OPTIONAL
- -This function is called before
-
OPTIONAL
+ +This function is called before
+
OPTIONAL
- -This function is called after
-
OPTIONAL
+ +This function is called after
+
OPTIONAL
- -This function is called whenever a test case (or config function)
- fails. It is called after the post function has been called for
- the failed test case. 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 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
OPTIONAL
- -This function is called whenever a test case (or config function)
- is skipped. It is called after the post function has been called
- for the skipped test case. 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 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
OPTIONAL
+OPTIONAL
-This function is called at the end of a CTH's
-
This function is called at the end of a CTH
+
OPTIONAL
- -The
This function should NOT have any side effects as it might - be called multiple times by Common Test.
+OPTIONAL
-If not implemented the CTH will act as if this function returned a
- call to
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