@@ -281,6 +281,49 @@ After any post hook has been executed for all installed CTHs,
281281skipped, respectively. You cannot affect the outcome of the tests any further at
282282this point.
283283
284+ [ ] ( ) {: #comment }
285+
286+ ### Comment in hooks
287+
288+ As mentioned in ` ct:comment/1 ` same limitation regarding calling ` ct:comment/1-2 `
289+ exists in hook functions. Calling ` ct:comment/1-2 ` should only be done directly from
290+ the process executing hook function, or it's descendant.
291+
292+ Be aware that if you spawn a process in one hook function and keep it alive
293+ while common_test has moved to calling another hook function, and you try to
294+ execute ` ct:comment/1-2 ` from this process the comment may not be printed in
295+ correct place in html logs, or at all.
296+
297+ Calling this function from process that is neither a common_test process, nor it's
298+ descendant is no-op.
299+
300+ This table presents information where ` ct:comment/1-2 ` prints to, depending on how hook was installed:
301+
302+ | Hook function | Install in: ` ct_run ` , ` ct:run_test/1 ` , Test Specification | Install in: suite/0, init_per_suite/1, init_per_group/2 |
303+ | -------------------------- | --------------------------------------------------------- | ------------------------------------------------------- |
304+ | id/1 | init_per_suite row | init_per_suite row |
305+ | init/2 | nowhere | init_per_suite row |
306+ | post_all/3 | nowhere | nowhere |
307+ | post_groups/4 | nowhere | nowhere |
308+ | pre_init_per_suite/3 | init_per_suite row | init_per_suite row |
309+ | post_init_per_suite/4 | init_per_suite row | init_per_suite row |
310+ | pre_init_per_group/3,4 | init_per_group row | init_per_group row |
311+ | post_init_per_group/4,5 | init_per_group row | init_per_group row |
312+ | pre_init_per_testcase/3,4 | testcase row | testcase row |
313+ | post_init_per_testcase/4,5 | testcase row | testcase row |
314+ | post_init_per_testcase/4,5 | testcase row | testcase row |
315+ | pre_end_per_testcase/3,4 | testcase row | testcase row |
316+ | post_end_per_testcase/4,5 | testcase row | testcase row |
317+ | pre_end_per_group/3,4 | end_per_group row | end_per_group row |
318+ | post_end_per_group/4,5 | end_per_group row | end_per_group row |
319+ | pre_end_per_suite/3 | end_per_suite row | end_per_suite row |
320+ | post_end_per_suite/4 | end_per_suite row | end_per_suite row |
321+ | on_tc_skip/4 | testcase row | testcase row |
322+ | on_tc_fail/4 | nowhere | nowhere |
323+ | terminate/1 | nowhere | end_per_suite row |
324+
325+ _ Table: Behavior of ` ct:comment/1-2 ` depending on hook installation method_
326+
284327[ ] ( ) {: #synchronizing }
285328
286329## Synchronizing External User Applications with Common Test
0 commit comments