Next: , Previous: Running Multiple Cases, Up: Advanced Features



4.2 No Fork Mode

Check normally forks to create a separate address space. This allows a signal or early exit to be caught and reported, rather than taking down the entire test program, and is normally very useful. However, when you are trying to debug why the segmentation fault or other program error occurred, forking makes it difficult to use debugging tools. To define fork mode for an SRunner object, you can do one of the following:

  1. Define the CK_FORK environment variable to equal “no”.
  2. Explicitly define the fork status through the use of the following function:
         
         void srunner_set_fork_status (SRunner * sr, enum fork_status fstat);
    

The enum fork_status allows the fstat parameter to assume the following values: CK_FORK and CK_NOFORK. An explicit call to srunner_set_fork_status() overrides the CK_FORK environment variable.