]> granicus.if.org Git - check/commitdiff
Added initial control functions to control forking
authoramalec <amalec@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Thu, 6 Sep 2001 18:10:22 +0000 (18:10 +0000)
committeramalec <amalec@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Thu, 6 Sep 2001 18:10:22 +0000 (18:10 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@91 64e312b2-a51f-0410-8e61-82d0ca0eb02a

13 files changed:
check/Doxyfile
check/configure.in
check/src/check.h
check/src/check_impl.h
check/src/check_log.c
check/src/check_log.h
check/src/check_print.c
check/src/check_print.h
check/src/check_run.c
check/tests/Makefile.am
check/tests/Makefile.in
check/tests/check_check.h
check/tests/check_check_main.c

index ec744fbbacfd65095622f111b48445e0751641d1..a82433f8eb53ee854988b24d1819bcf9a523c61d 100644 (file)
@@ -4,12 +4,12 @@
 # General configuration options
 #---------------------------------------------------------------------------
 PROJECT_NAME           = Check
-PROJECT_NUMBER         = 0.7.0
+PROJECT_NUMBER         = 0.8.0
 OUTPUT_DIRECTORY       = ./doc/
 OUTPUT_LANGUAGE        = English
 EXTRACT_ALL            = NO
 EXTRACT_PRIVATE        = NO
-EXTRACT_STATIC         = NO
+EXTRACT_STATIC         = YES
 HIDE_UNDOC_MEMBERS     = NO
 HIDE_UNDOC_CLASSES     = NO
 BRIEF_MEMBER_DESC      = YES
@@ -33,11 +33,11 @@ INLINE_INFO            = YES
 SORT_MEMBER_DOCS       = YES
 DISTRIBUTE_GROUP_DOC   = NO
 TAB_SIZE               = 8
-ENABLED_SECTIONS       = 
 GENERATE_TODOLIST      = YES
 GENERATE_TESTLIST      = YES
 GENERATE_BUGLIST       = YES
 ALIASES                = 
+ENABLED_SECTIONS       = 
 MAX_INITIALIZER_LINES  = 30
 OPTIMIZE_OUTPUT_FOR_C  = YES
 SHOW_USED_FILES        = YES
@@ -141,10 +141,12 @@ PERL_PATH              = /usr/bin/perl
 HAVE_DOT               = NO
 CLASS_GRAPH            = YES
 COLLABORATION_GRAPH    = YES
+TEMPLATE_RELATIONS     = YES
 INCLUDE_GRAPH          = YES
 INCLUDED_BY_GRAPH      = YES
 GRAPHICAL_HIERARCHY    = YES
 DOT_PATH               = 
+DOTFILE_DIRS           = 
 MAX_DOT_GRAPH_WIDTH    = 1024
 MAX_DOT_GRAPH_HEIGHT   = 1024
 GENERATE_LEGEND        = YES
index a7ccc61d0bfa116b73d559052177895c29346cd5..1db616545d241ce0164c9729f3951d33a328fd9c 100644 (file)
@@ -40,8 +40,10 @@ AC_TYPE_PID_T
 AC_TYPE_SIZE_T
 
 dnl Checks for library functions.
+dnl AC_FUNC_FORK
+dnl AC_FUNC_MALLOC
 AC_FUNC_VPRINTF
-AC_CHECK_FUNCS(strerror)
+AC_CHECK_FUNCS([strerror])
 
 AC_OUTPUT(Makefile
          src/Makefile
index 21b911fa431218b66b3a29bc8825e7a597b01826..6f1f010a56a98b9c403631646f570c6c0527ef85 100644 (file)
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 
-/* Comments are in Doxygen format: see http://www.stack.nl/~dimitri/doxygen/ */
 
-/*! \mainpage Check: a unit test framework for C
+/* Check: a unit test framework for C
 
-\section overview
+   Check is a unit test framework for C. It features a simple
+   interface for defining unit tests, putting little in the way of the
+   developer. Tests are run in a separate address space, so Check can
+   catch both assertion failures and code errors that cause
+   segmentation faults or other signals. The output from unit tests
+   can be used within source code editors and IDEs.
 
-Overview Check is a unit test framework for C. It features a simple
-interface for defining unit tests, putting little in the way of the
-developer. Tests are run in a separate address space, so Check can
-catch both assertion failures and code errors that cause segmentation
-faults or other signals. The output from unit tests can be used within
-source code editors and IDEs.
+   Unit tests are created with the START_TEST/END_TEST macro
+   pair. The fail_unless and fail macros are used for creating
+   checks within unit tests; the mark_point macro is useful for
+   trapping the location of signals and/or early exits.
 
-\section quickref Quick Reference
 
-\subsection creating Creating
+   Test cases are created with tcase_create, unit tests are added
+   with tcase_add_test
 
-\par
 
-Unit tests are created with the #START_TEST/#END_TEST macro pair. The
-#fail_unless and #fail macros are used for creating checks within unit
-tests; the #mark_point macro is useful for trapping the location of
-signals and/or early exits.
+   Suites are created with suite_create, freed with suite_free; test
+   cases are added with suite_add_tcase
 
-\subsection managing Managing test cases and suites
+   Suites are run through an SRunner, which is created with
+   srunner_create, freed with srunner_free. Additional suites can be
+   added to an SRunner with srunner_add_suite.
 
-\par
-
-Test cases are created with #tcase_create, unit tests are added
-with #tcase_add_test
-
-\par
-
-Suites are created with #suite_create, freed with #suite_free; test
-cases are added with #suite_add_tcase
-
-\subsection running Running suites
-
-\par
-
-Suites are run through an SRunner, which is created with
-#srunner_create, freed with #srunner_free. Additional suites can be
-added to an SRunner with #srunner_add_suite.
-
-\par
-
-Use #srunner_run_all to run a suite and print results.
+   Use srunner_run_all to run a suite and print results.
 
 */
 
-/*! \file check.h */
 
 #ifdef __cplusplus
-extern "C" { 
-#endif 
-
-
-/*! \defgroup check_core Check Core
-  Core suite/test case types and functions
-  @{
-*/
-
-/*! \brief opaque type for a test suite */
-typedef struct Suite Suite;
+#define CK_CPPSTART extern "C" {
+CK_CPPSTART
+#endif
+  
 
-/*! \brief opaque type for a test case
+/* opaque type for a test case
 
-A TCase represents a test case.  Create with #tcase_create, free with
-#tcase_free.  For the moment, test cases can only be run through a
-suite
+   A TCase represents a test case.  Create with tcase_create, free
+   with tcase_free.  For the moment, test cases can only be run
+   through a suite
 */
   
 typedef struct TCase TCase; 
 
-/*! type for a test function */
+/* type for a test function */
 typedef void (*TFun) (void);
 
-/*! type for a setup/teardown function */
+/* type for a setup/teardown function */
 typedef void (*SFun) (void);
-
-/*! Create a test suite */
+/* Opaque type for a test suite */
+typedef struct Suite Suite;
+/* Creates a test suite with the given name
+*/
 Suite *suite_create (char *name);
 
-/*! Free a test suite
-  (For the moment, this also frees all contained test cases) */
+/* Free a test suite (For the moment, this also frees all contained
+  test cases) */
 void suite_free (Suite *s);
 
-/*! Create a test case */
+/* Add a test case to a suite */
+void suite_add_tcase (Suite *s, TCase *tc);
+
+/* Create a test case */
 TCase *tcase_create (char *name);
 
-/*! Free a test case
-  (Note that as it stands, one will normally free the contaning suite) */
+/* Free a test case
+
+   (Note that as it stands, one will normally free the contaning
+   suite) */
 void tcase_free (TCase *tc);
 
-/*! Add a test case to a suite */
-void suite_add_tcase (Suite *s, TCase *tc);
 
-/*! Add a test function to a test case
+/* Add a test function to a test case
   (macro version) */
 #define tcase_add_test(tc,tf) _tcase_add_test(tc,tf,"" # tf "")
-/*! Add a test function to a test case
+
+/* Add a test function to a test case
   (function version -- use this when the macro won't work */
 void _tcase_add_test (TCase *tc, TFun tf, char *fname);
 
-/*!
+/* Add fixture setup/teardown functions to a test case
 
-Add fixture setup/teardown functions to a test case Note that
-setup/teardown functions are not run in a separate address space, like
-test functions, and so must not exit or signal (e.g., segfault)
+   Note that setup/teardown functions are not run in a separate
+   address space, like test functions, and so must not exit or signal
+   (e.g., segfault)
 
 */
 void tcase_set_fixture(TCase *tc, SFun setup, SFun teardown);
 
-/*! Internal function to mark the start of a test function */
+/* Internal function to mark the start of a test function */
 void tcase_fn_start (char *fname, char *file, int line);
 
-/*! Start a unit test with START_TEST(unit_name), end with END_TEST
-  One must use braces within a START_/END_ pair to declare new variables */
+/* Start a unit test with START_TEST(unit_name), end with END_TEST
+   One must use braces within a START_/END_ pair to declare new variables */
+
 #define START_TEST(__testname)\
 static void __testname (void)\
 {\
   tcase_fn_start (""# __testname, __FILE__, __LINE__);
 
-/*! End a unit test */
+/* End a unit test */
 #define END_TEST }
 
 
-/*! Fail the test case unless result is true */
+/* Fail the test case unless result is true */
 #define fail_unless(result,msg) _fail_unless(result,__FILE__,__LINE__,msg)
   
-/*! Non macro version of #fail_unless, with more complicated interface */
+/* Non macro version of #fail_unless, with more complicated interface */
 void _fail_unless (int result, char *file, int line, char *msg);
 
-/*! Always fail */
+/* Always fail */
 #define fail(msg) _fail_unless(0,__FILE__,__LINE__,msg)
 
-/*! Mark the last point reached in a unit test
-   (useful for tracking down where a segfault, etc. occurs */
+/* Mark the last point reached in a unit test
+   
+   (useful for tracking down where a segfault, etc. occurs) */
 #define mark_point() _mark_point(__FILE__,__LINE__)
-/*! Non macro version of #mark_point */
-void _mark_point (char *file, int line);
-
-/*! @} */
-
-/*! \defgroup check_run Suite running functions
-  @{
-*/
 
+/* Non macro version of #mark_point */
+void _mark_point (char *file, int line);
 
-/*! Result of a test */
+/* Result of a test */
 enum test_result {
-  CRPASS, /*!< Test passed*/
-  CRFAILURE, /*!< Test completed but failed */
-  CRERROR /*!< Test failed to complete (signal or non-zero early exit) */
+  CRPASS, /* Test passed*/
+  CRFAILURE, /* Test completed but failed */
+  CRERROR /* Test failed to complete (signal or non-zero early exit) */
 };
 
-/*! Specifies the verbosity of srunner printing */
-enum print_verbosity {
-  CRSILENT, /*!< No output */
-  CRMINIMAL, /*!< Only summary output */
-  CRNORMAL, /*!< All failed tests */
-  CRVERBOSE, /*!< All tests */
+/* Specifies the how much output an SRunner should produce */
+enum print_output {
+  CRSILENT, /* No output */
+  CRMINIMAL, /* Only summary output */
+  CRNORMAL, /* All failed tests */
+  CRVERBOSE, /* All tests */
   CRLAST
 };
 
 
-/*! Holds state for a running of a test suite */
+/* Holds state for a running of a test suite */
 typedef struct SRunner SRunner;
 
-/*! Opaque type for a test failure */
+/* Opaque type for a test failure */
 typedef struct TestResult TestResult;
 
 /* accessors for tr fields */
 
-/*! Type of result */
+/* Type of result */
 int tr_rtype (TestResult *tr);
-/*! Failure message */
+/* Failure message */
 char *tr_msg (TestResult *tr);
-/*! Line number at which failure occured */
+/* Line number at which failure occured */
 int tr_lno (TestResult *tr);
-/*! File name at which failure occured */
+/* File name at which failure occured */
 char *tr_lfile (TestResult *tr);
-/*! Test case in which unit test was run */
+/* Test case in which unit test was run */
 char *tr_tcname (TestResult *tr);
 
-/*! Creates an SRunner for the given suite */
+/* Creates an SRunner for the given suite */
 SRunner *srunner_create (Suite *s);
 
-/*! Adds a Suite to an SRunner */
+/* Adds a Suite to an SRunner */
 void srunner_add_suite (SRunner *sr, Suite *s);
 
-/*! Frees an SRunner */
+/* Frees an SRunner */
 void srunner_free (SRunner *sr);
 
 /* Test running */
 
-/*! Runs an SRunner, printing results as specified
-    (see enum #print_verbosity)*/
-void srunner_run_all (SRunner *sr, int print_mode);
+/* Runs an SRunner, printing results as specified (see enum
+   print_output)*/
+void srunner_run_all (SRunner *sr, enum print_output print_mode);
 
 /* Next functions are valid only after the suite has been
    completely run, of course */
 
-/*! Number of failed tests in a run suite
+/* Number of failed tests in a run suite
+
   Includes failures + errors */
 int srunner_ntests_failed (SRunner *sr);
 
-/*! Total number of tests run in a run suite */
+/* Total number of tests run in a run suite */
 int srunner_ntests_run (SRunner *sr);
 
-/*! \brief Return an array of results for all failures
+/* Return an array of results for all failures
   
-   Number of failures is equal to #srunner_nfailed_tests.  Memory is
-   alloc'ed and must be freed, but individual TestResults must not */
+   Number of failures is equal to srunner_nfailed_tests.  Memory for
+   the array is malloc'ed and must be freed, but individual TestResults
+   must not */
 
 TestResult **srunner_failures (SRunner *sr);
 
-/*! \brief Return an array of results for all run tests
+/* Return an array of results for all run tests
+
+   Number of results is equal to srunner_ntests_run
 
-Number of failrues is equal to #srunner_ntests_run Memory is alloc'ed
-and must be freed, but individual TestResults must not */
+   Memory is malloc'ed and must be freed, but individual TestResults
+   must not */
   
 TestResult **srunner_results (SRunner *sr);
-  /* Printing */
-
-/*! Print the results contained in an SRunner
+/* Printing */
 
-\param sr SRunner for which results are printed
-
-\param print_mode Specification of print verbosity, constrainted to
-enum #print_verbosity
+/* Print the results contained in an SRunner
 */
-  void srunner_print (SRunner *sr, int print_mode);
+void srunner_print (SRunner *sr, enum print_output print_mode);
   
-/*! @} */
-
-
-/*! \defgroup check_log Logging functions
-  @{
-*/
   
-/*! Set a log file to which to write during test running.
-  Log file setting is an initialize only operation -- it should be done
-  immediatly after SRunner creation, and the log file can't be changed
-  after being set.
-  \param sr The SRunner for which to enable logging
-  \param fname The file name to which to write the log
+/* Set a log file to which to write during test running.
+
+  Log file setting is an initialize only operation -- it should be
+  done immediatly after SRunner creation, and the log file can't be
+  changed after being set.
  */
 void srunner_set_log (SRunner *sr, char *fname);
 
-/*! Does the SRunner have a log file?
-  \param sr The SRunner to test
-  \return True if logging, False otherwise
+/* Does the SRunner have a log file?
 */
 int srunner_has_log (SRunner *sr);
 
-/*! Return the name of the log file, or NULL if none
-  \param sr The SRunner to query
-  \return The current log file, or NULL if not logging
+/* Return the name of the log file, or NULL if none
 */
 char *srunner_log_fname (SRunner *sr);
 
-/*! @} */
+/* Control forking */
+enum fork_status {
+  CK_FORK,
+  CK_NOFORK
+};
+enum fork_status srunner_fork_status (SRunner *sr);
+void srunner_set_fork_status (SRunner *sr, enum fork_status fstat); 
   
 #ifdef __cplusplus 
-}
+#define CK_CPPEND }
+CL_CPPEND
 #endif
 
 #endif /* CHECK_H */
index 7b1e6ac5fcf62bb52fc1f15807120ab56687ba9d..a0a70418918a9c361efb2f27bde47bf39812f176 100644 (file)
@@ -71,14 +71,14 @@ enum cl_event {
   CLEND_T
 };
 
-typedef void (*LFun) (SRunner *, FILE*, enum print_verbosity,
+typedef void (*LFun) (SRunner *, FILE*, enum print_output,
                      void *, enum cl_event);
 
 typedef struct Log {
   FILE *lfile;
   LFun lfun;
   int close;
-  enum print_verbosity mode;
+  enum print_output mode;
 } Log;
 
 struct SRunner {
@@ -87,6 +87,7 @@ struct SRunner {
   List *resultlst;
   char *log_fname;
   List *loglst;
+  enum fork_status fstat;
 };
 
 
index 501c68cb67cce12b5bcc6d332ec44c238c124f03..f61ac6d59df8d0098a0e8cde4011ccc7a7e50106 100644 (file)
@@ -46,7 +46,7 @@ char *srunner_log_fname (SRunner *sr)
 }
 
 void srunner_register_lfun (SRunner *sr, FILE *lfile, int close,
-                           LFun lfun, enum print_verbosity printmode)
+                           LFun lfun, enum print_output printmode)
 {
   Log *l = emalloc (sizeof(Log));
   l->lfile = lfile;
@@ -95,7 +95,7 @@ static void srunner_send_evt (SRunner *sr, void *obj, enum cl_event evt)
   }
 }
 
-void stdout_lfun (SRunner *sr, FILE *file, enum print_verbosity printmode,
+void stdout_lfun (SRunner *sr, FILE *file, enum print_output printmode,
                  void *obj, enum cl_event evt)
 {
   TestResult *tr;
@@ -132,7 +132,7 @@ void stdout_lfun (SRunner *sr, FILE *file, enum print_verbosity printmode,
   
 }
 
-void lfile_lfun (SRunner *sr, FILE *file, enum print_verbosity printmode,
+void lfile_lfun (SRunner *sr, FILE *file, enum print_output printmode,
                 void *obj, enum cl_event evt)
 {
   TestResult *tr;
@@ -174,7 +174,7 @@ FILE *srunner_open_lfile (SRunner *sr)
   return f;
 }
 
-void srunner_init_logging (SRunner *sr, enum print_verbosity print_mode)
+void srunner_init_logging (SRunner *sr, enum print_output print_mode)
 {
   FILE *f;
   sr->loglst = list_create();
index a7205d7db3c4ec5f92bf6161cc4559b0496a0302..8e2addf834a7bf7e9836e73db8b752a46073bdb7 100644 (file)
@@ -7,17 +7,17 @@ void log_suite_start (SRunner *sr, Suite *s);
 void log_suite_end (SRunner *sr, Suite *s);
 void log_test_end (SRunner *sr, TestResult *tr);
 
-void stdout_lfun (SRunner *sr, FILE *file, enum print_verbosity,
+void stdout_lfun (SRunner *sr, FILE *file, enum print_output,
                  void *obj, enum cl_event evt);
 
-void lfile_lfun (SRunner *sr, FILE *file, enum print_verbosity,
+void lfile_lfun (SRunner *sr, FILE *file, enum print_output,
                  void *obj, enum cl_event evt);
 
 void srunner_register_lfun (SRunner *sr, FILE *lfile, int close,
-                           LFun lfun, enum print_verbosity);
+                           LFun lfun, enum print_output);
 
 FILE *srunner_open_lfile (SRunner *sr);
-void srunner_init_logging (SRunner *sr, enum print_verbosity print_mode);
+void srunner_init_logging (SRunner *sr, enum print_output print_mode);
 void srunner_end_logging (SRunner *sr);
 
 #endif /* CHECK_LOG_H */
index 5c3dc2939f3c840c4335f6244f823d26d507d379..1bbaf60aa12577e83656810abdf45e4a58006260 100644 (file)
 #include "check_str.h"
 #include "check_print.h"
 
-static void srunner_fprint_summary (FILE *file, SRunner *sr, int print_mode);
-static void srunner_fprint_results (FILE *file, SRunner *sr, int print_mode);
+static void srunner_fprint_summary (FILE *file, SRunner *sr,
+                                   enum print_output print_mode);
+static void srunner_fprint_results (FILE *file, SRunner *sr,
+                                   enum print_output print_mode);
 
 
-void srunner_print (SRunner *sr, int print_mode)
+void srunner_print (SRunner *sr, enum print_output print_mode)
 {
   srunner_fprint (stdout, sr, print_mode);
 }
 
-void srunner_fprint (FILE *file, SRunner *sr, int print_mode)
+void srunner_fprint (FILE *file, SRunner *sr, enum print_output print_mode)
 {
   srunner_fprint_summary (file, sr, print_mode);
   srunner_fprint_results (file, sr, print_mode);
 }
 
-static void srunner_fprint_summary (FILE *file, SRunner *sr, int print_mode)
+static void srunner_fprint_summary (FILE *file, SRunner *sr,
+                                   enum print_output print_mode)
 {
   if (print_mode >= CRMINIMAL) {
     char *str;
@@ -53,7 +56,8 @@ static void srunner_fprint_summary (FILE *file, SRunner *sr, int print_mode)
   return;
 }
 
-static void srunner_fprint_results (FILE *file, SRunner *sr, int print_mode)
+static void srunner_fprint_results (FILE *file, SRunner *sr,
+                                   enum print_output print_mode)
 {
   List *resultlst;
   
@@ -66,7 +70,7 @@ static void srunner_fprint_results (FILE *file, SRunner *sr, int print_mode)
   return;
 }
 
-void tr_fprint (FILE *file, TestResult *tr, int print_mode)
+void tr_fprint (FILE *file, TestResult *tr, enum print_output print_mode)
 {
   if ((print_mode >= CRVERBOSE && tr->rtype == CRPASS) ||
       (tr->rtype != CRPASS && print_mode >= CRNORMAL)) {
index ee90905b1626ba1c3215243268fc84375133b2c4..43f14b5a4e1a26d2245b7492deeb0a3c99448be1 100644 (file)
@@ -20,8 +20,8 @@
 #ifndef CHECK_PRINT_H
 #define CHECK_PRINT_H
 
-void tr_fprint (FILE *file, TestResult *tr, int print_mode);
-void srunner_fprint (FILE *file, SRunner *sr, int print_mode);
+void tr_fprint (FILE *file, TestResult *tr, enum print_output print_mode);
+void srunner_fprint (FILE *file, SRunner *sr, enum print_output print_mode);
 
 
 #endif /* CHECK_PRINT_H */
index 8da0704f09dd53c6a55c1f77891e6a4dbc44d56f..dc938320d5b6b269884479064e118136a4b0eb65 100644 (file)
 #include "check_log.h"
 
 
-static void srunner_run_init (SRunner *sr, enum print_verbosity print_mode);
-static void srunner_run_end (SRunner *sr, enum print_verbosity print_mode);
+static void srunner_run_init (SRunner *sr, enum print_output print_mode);
+static void srunner_run_end (SRunner *sr, enum print_output print_mode);
 static void srunner_iterate_suites (SRunner *sr,
-                                   enum print_verbosity print_mode);
+                                   enum print_output print_mode);
 static void srunner_run_tcase (SRunner *sr, TCase *tc);
 static void srunner_add_failure (SRunner *sr, TestResult *tf);
 static TestResult *tfun_run (char *tcname, TF *tf);
@@ -58,6 +58,7 @@ SRunner *srunner_create (Suite *s)
   sr->resultlst = list_create();
   sr->log_fname = NULL;
   sr->loglst = NULL;
+  sr->fstat = CK_FORK;
   return sr;
 }
 
@@ -89,13 +90,13 @@ void srunner_free (SRunner *sr)
   free (sr);
 }
 
-static void srunner_run_init (SRunner *sr, enum print_verbosity print_mode)
+static void srunner_run_init (SRunner *sr, enum print_output print_mode)
 {
   srunner_init_logging (sr, print_mode);
   log_srunner_start (sr);
 }
 
-static void srunner_run_end (SRunner *sr, enum print_verbosity print_mode)
+static void srunner_run_end (SRunner *sr, enum print_output print_mode)
 {
 
   log_srunner_end (sr);
@@ -103,7 +104,7 @@ static void srunner_run_end (SRunner *sr, enum print_verbosity print_mode)
 }
 
 static void srunner_iterate_suites (SRunner *sr,
-                                   enum print_verbosity print_mode)
+                                   enum print_output print_mode)
   
 {
   List *slst;
@@ -126,7 +127,7 @@ static void srunner_iterate_suites (SRunner *sr,
   }
 }
 
-void srunner_run_all (SRunner *sr, int print_mode)
+void srunner_run_all (SRunner *sr, enum print_output print_mode)
 {
   if (sr == NULL)
     return;
@@ -348,3 +349,14 @@ static int non_pass (int val)
 {
   return val == CRFAILURE || val == CRERROR;
 }
+
+enum fork_status srunner_fork_status (SRunner *sr)
+{
+  return sr->fstat;
+}
+
+void srunner_set_fork_status (SRunner *sr, enum fork_status fstat)
+{
+  sr->fstat = fstat;
+}
+
index ee221660dc988d4c558af82503c71271dc9ee26e..030315df5c31c5301464eb9ba4d9868a1dce08e0 100644 (file)
@@ -21,6 +21,7 @@ check_check_SOURCES= \
        check_check_msg.c\
        check_check_log.c\
        check_check_limit.c\
+       check_check_fork.c\
        check_check_main.c
 
 check_stress_SOURCES=\
index 8220c2fbc81449a60c2a489b9ecaf3ebda0c6dc6..cb82805a768f41256788c2387b2870a45ba46ea7 100644 (file)
@@ -75,7 +75,7 @@ noinst_PROGRAMS =     check_check     check_stress    ex_output       ex_log_output   ex_setu
 
 EXTRA_DIST = test_output.sh test_log_output.sh
 
-check_check_SOURCES =          check_check.h   check_list.c    check_check_sub.c       check_check_master.c    check_check_msg.c       check_check_log.c       check_check_limit.c     check_check_main.c
+check_check_SOURCES =          check_check.h   check_list.c    check_check_sub.c       check_check_master.c    check_check_msg.c       check_check_log.c       check_check_limit.c     check_check_fork.c      check_check_main.c
 
 
 check_stress_SOURCES =         check_stress.c
@@ -106,7 +106,7 @@ LDFLAGS = @LDFLAGS@
 LIBS = @LIBS@
 check_check_OBJECTS =  check_list.o check_check_sub.o \
 check_check_master.o check_check_msg.o check_check_log.o \
-check_check_limit.o check_check_main.o
+check_check_limit.o check_check_fork.o check_check_main.o
 check_check_LDADD = $(LDADD)
 check_check_DEPENDENCIES =  ../src/libcheck.a
 check_check_LDFLAGS = 
@@ -137,11 +137,11 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
 TAR = tar
 GZIP_ENV = --best
-DEP_FILES =  .deps/check_check_limit.P .deps/check_check_log.P \
-.deps/check_check_main.P .deps/check_check_master.P \
-.deps/check_check_msg.P .deps/check_check_sub.P .deps/check_list.P \
-.deps/check_stress.P .deps/ex_log_output.P .deps/ex_output.P \
-.deps/ex_setup_output.P
+DEP_FILES =  .deps/check_check_fork.P .deps/check_check_limit.P \
+.deps/check_check_log.P .deps/check_check_main.P \
+.deps/check_check_master.P .deps/check_check_msg.P \
+.deps/check_check_sub.P .deps/check_list.P .deps/check_stress.P \
+.deps/ex_log_output.P .deps/ex_output.P .deps/ex_setup_output.P
 SOURCES = $(check_check_SOURCES) $(check_stress_SOURCES) $(ex_output_SOURCES) $(ex_log_output_SOURCES) $(ex_setup_output_SOURCES)
 OBJECTS = $(check_check_OBJECTS) $(check_stress_OBJECTS) $(ex_output_OBJECTS) $(ex_log_output_OBJECTS) $(ex_setup_output_OBJECTS)
 
index 9ee2bdf1ff9bf7ec6845d2e442693e2d780accaf..7005084c633ad549246d45fe54ba4ee640181f96 100644 (file)
@@ -13,6 +13,6 @@ Suite *make_list_suite(void);
 Suite *make_msg_suite(void);
 Suite *make_log_suite(void);
 Suite *make_limit_suite(void);
-
+Suite *make_fork_suite(void);
 
 #endif /* CHECK_CHECK_H */
index 498c475b634ff4cc6f63db5b5869de3897f76731..b65180033470e3a5bfa148fd6fa6b85b91c24d15 100644 (file)
@@ -14,6 +14,7 @@ int main (void)
   srunner_add_suite(sr, make_msg_suite());
   srunner_add_suite(sr, make_log_suite());
   srunner_add_suite(sr, make_limit_suite());
+  srunner_add_suite(sr, make_fork_suite());
   
   setup();
   printf ("Ran %d tests in subordinate suite\n", sub_nfailed);