checked fixtures allow setup and teardown functions to be run in the
same process space as tests. If a fixture fails, the error is caught
and reported as a failure for the associated test.
If fork is not used, then the guarantee that checked fixtures try to
provide is not possible. Further, using checked fixtures without fork can
cause issues. For example, without fork if a checked teardown
calls ck_assert() which fails, this results in longjmp being called,
which results in the teardowns being called again. An infinate loop
results.
git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@795
64e312b2-a51f-0410-8e61-
82d0ca0eb02a
void tcase_add_checked_fixture (TCase *tc, SFun setup, SFun teardown)
{
+#if defined(HAVE_FORK)
tcase_add_fixture (tc,setup,teardown,1);
+#else
+ eprintf("This version does not support checked fixtures, as fork is not supported", __FILE__, __LINE__);
+#endif
}
static void tcase_add_fixture (TCase *tc, SFun setup, SFun teardown,