The default fork mode is CK_FORK_GETENV, which checks the
environment, and failing that falls back on using fork.
If fork is unavailable, the default is now to set CK_NOFORK.
git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@774
64e312b2-a51f-0410-8e61-
82d0ca0eb02a
sr->log_fname = NULL;
sr->xml_fname = NULL;
sr->loglst = NULL;
+
+#if defined(HAVE_FORK)
sr->fstat = CK_FORK_GETENV;
+#else
+ /*
+ * Overriding the default of running tests in fork mode,
+ * as this system does not have fork()
+ */
+ sr->fstat = CK_NOFORK;
+#endif /* HAVE_FORK */
+
return sr;
}
START_TEST(test_default_fork)
{
+#if defined(HAVE_FORK)
ck_assert_msg(srunner_fork_status(fork_dummy_sr) == CK_FORK,
"Default fork status not set correctly");
+#else
+ ck_assert_msg(srunner_fork_status(fork_dummy_sr) == CK_NOFORK,
+ "Default fork status not set correctly");
+#endif /* HAVE_FORK */
}
END_TEST