diff options
author | Peter Andersson <[email protected]> | 2012-03-28 14:06:59 +0200 |
---|---|---|
committer | Peter Andersson <[email protected]> | 2012-03-29 00:03:51 +0200 |
commit | 96b3f1cdf435954b826be3da8de714b13910d396 (patch) | |
tree | 48cec4236dd63b7afe0b5b64c4b3f012d88df22c /lib/common_test/doc/src/ct_hooks_chapter.xml | |
parent | effdfdc5a7a2d70ea4ce34ce446c9490f424f2d7 (diff) | |
download | otp-96b3f1cdf435954b826be3da8de714b13910d396.tar.gz otp-96b3f1cdf435954b826be3da8de714b13910d396.tar.bz2 otp-96b3f1cdf435954b826be3da8de714b13910d396.zip |
Update documentation
OTP-9972
OTP-9659
OTP-9855
OTP-9880
OTP-9973
OTP-9986
OTP-9992
OTP-9935
Diffstat (limited to 'lib/common_test/doc/src/ct_hooks_chapter.xml')
-rw-r--r-- | lib/common_test/doc/src/ct_hooks_chapter.xml | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/lib/common_test/doc/src/ct_hooks_chapter.xml b/lib/common_test/doc/src/ct_hooks_chapter.xml index c5b4fd0073..cb06e570bd 100644 --- a/lib/common_test/doc/src/ct_hooks_chapter.xml +++ b/lib/common_test/doc/src/ct_hooks_chapter.xml @@ -189,6 +189,22 @@ it.</p> </section> + <section> + <title>External configuration data and Logging</title> + <p>It's possible in the CTH to read configuration data values + by calling <c>ct:get_config/1/2/3</c> (as explained in the + <seealso marker="config_file_chapter#require_config_data"> + External configuration data</seealso> + chapter). The config variables in question must, as always, first have been + <c>required</c> by means of a suite-, group-, or test case info function, + or the <c>ct:require/1/2</c> function. Note that the latter can also be used + in CT hook functions.</p> + <p>The CT hook functions may call any of the logging functions available + in the <c>ct</c> interface to print information to the log files, or to + add comments in the suite overview page. + </p> + </section> + </section> <marker id="manipulating"/> @@ -201,11 +217,13 @@ functions for a CTH follow a common interface, this interface is described below.</p> - <p>It is only possible to hook into test function which exists in the test - suite. So in order for a CTH to hook in before - <seealso marker="common_test#Module:init_per_suite-1">init_per_suite</seealso>, - the <seealso marker="common_test#Module:init_per_suite-1">init_per_suite</seealso> - function must exist in the test suite.</p> + <p>Common Test will always call all available hook functions, even pre- and post + hooks for configuration functions that are not implemented in the suite. + For example, <c>pre_init_per_suite(x_SUITE, ...)</c> and + <c>post_init_per_suite(x_SUITE, ...)</c> will be called for test suite + <c>x_SUITE</c>, even if it doesn't export <c>init_per_suite/1</c>. This feature + makes it possible to use hooks as configuration fallbacks, or even + completely replace all configuration functions with hook functions.</p> <marker id="pre"/> <section> |