sr->log_fname = NULL;
sr->xml_fname = NULL;
sr->loglst = NULL;
- sr->fstat = CK_FORK_UNSPECIFIED;
+ sr->fstat = CK_FORK_GETENV;
return sr;
}
void set_fork_status (enum fork_status fstat)
{
- if (fstat == CK_FORK || fstat == CK_NOFORK)
+ if (fstat == CK_FORK || fstat == CK_NOFORK || fstat == CK_FORK_GETENV)
_fstat = fstat;
else
eprintf ("Bad status in set_fork_status", __FILE__, __LINE__);
/* accessors for tr fields */
enum ck_result_ctx {
- CK_CTX_INVALID,
+ CK_CTX_INVALID, /* Default value; should not encounter this */
CK_CTX_SETUP,
CK_CTX_TEST,
CK_CTX_TEARDOWN
/* Control forking */
enum fork_status {
- CK_FORK,
- CK_NOFORK
+ CK_FORK_GETENV, /* look in the environment for CK_FORK */
+ CK_FORK, /* call fork to run tests */
+ CK_NOFORK /* don't call fork */
};
/* Get the current fork status */
Include stdio.h & list.h before this header
*/
-/* magic values */
-
-/* Unspecified fork status, used only internally */
-#define CK_FORK_UNSPECIFIED -1
-
-
typedef struct TF {
TFun fn;
int loop_start;
enum fork_status srunner_fork_status (SRunner *sr)
{
- if (sr->fstat == CK_FORK_UNSPECIFIED) {
+ if (sr->fstat == CK_FORK_GETENV) {
char *env = getenv ("CK_FORK");
if (env == NULL)
return CK_FORK;