From: hugo303 Date: Mon, 14 Nov 2011 18:52:40 +0000 (+0000) Subject: * Corrected and clarified documentation on fixtures. X-Git-Tag: 0.10.0~572 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9f106e12a60d8a66122de64a80d666cc5cd87dd5;p=check * Corrected and clarified documentation on fixtures. git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@607 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- diff --git a/doc/check.texi b/doc/check.texi index 709b296..5d93d0e 100644 --- a/doc/check.texi +++ b/doc/check.texi @@ -945,7 +945,7 @@ function is run, if defined. After each unit test, the @code{teardown()} function is run, if defined. Since they run inside the forked address space, if checked fixtures signal or otherwise fail, they will be caught and reported by the @code{SRunner}. A -checked @code{teardown()} fixture will run even if the unit test +checked @code{teardown()} fixture will not run if the unit test fails. @item Unchecked fixtures @@ -953,9 +953,12 @@ are run in the same address space as the test program. Therefore they may not signal or exit, but may use the fail functions. The unchecked @code{setup()}, if defined, is run before the test case is started. The unchecked @code{teardown()}, if defined, is run after the -test case is done. +test case is done. An unchecked @code{teardown()} fixture will run even +if a unit test fails. @end table +An important difference is that the checked fixtures are run once per +unit test and the unchecked fixtures are run once per test case. So for a test case that contains @code{check_one()} and @code{check_two()} unit tests, @code{checked_setup()}/@code{checked_teardown()} checked fixtures, and