From b72ac8bb33177f6ca117fc0f7727d24de67cbc62 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 29 Jul 2011 14:47:00 +0200 Subject: Update to reflect addition of CTH priority addition --- lib/common_test/doc/src/ct_hooks_chapter.xml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'lib/common_test/doc/src/ct_hooks_chapter.xml') diff --git a/lib/common_test/doc/src/ct_hooks_chapter.xml b/lib/common_test/doc/src/ct_hooks_chapter.xml index fc5ab48e1b..dbb4310040 100644 --- a/lib/common_test/doc/src/ct_hooks_chapter.xml +++ b/lib/common_test/doc/src/ct_hooks_chapter.xml @@ -94,9 +94,11 @@ init_per_group/2. CTH in this case can be either only the module name of the CTH or a tuple with the module name and the - initial arguments to the CTH. Eg: + initial arguments and optionally the hook priority of the CTH. Eg: {ct_hooks,[my_cth_module]} or - {ct_hooks,[{my_cth_module,[{debug,true}]}]}

+ {ct_hooks,[{my_cth_module,[{debug,true}]}]} or + {ct_hooks,[{my_cth_module,[{debug,true}],500}]} +

Overriding CTHs @@ -109,7 +111,16 @@ id in both places, Common Test knows that this CTH has already been installed and will not try to install it again.

- + +
+ CTH Priority +

By default each CTH installed will be executed in the order which + they are installed. This is not always wanted so common_test allows + the user to specify a priority for each hook. The priority can either + be specified in the CTH init/2 + function or when installing the hook. The priority given at + installation will override the priority returned by the CTH.

+
@@ -331,7 +342,7 @@ id(Opts) -> %% any common state. init(Id, Opts) -> {ok,D} = file:open(Id,[write]), - #state{ file_handle = D, total = 0, data = [] }. + {ok, #state{ file_handle = D, total = 0, data = [] }}. %% @doc Called before init_per_suite is called. pre_init_per_suite(Suite,Config,State) -> -- cgit v1.2.3