Next: , Up: process   [Contents][Index]


7.1 Running a test in a subprocess

The following API allows us to run a test function in a subprocess. Example:

static cctests_child_process_function_t child_function;

void
test_1_1 (cce_destination_t upper_L)
{
  cctests_call_in_forked_process(upper_L, child_function);
}

void
child_function (cce_destination_t L)
/* This is run in a subprocess. */
{
  cctests_assert(L, true);
}
Function Prototype: void cctests_child_process_function_t (cce_destination_t L)

Type of function to call in a subprocess.

Function: void cctests_call_in_forked_process (cce_destination_t L, cctests_child_process_function_t * child_function)

Fork a process:


Next: , Up: process   [Contents][Index]

This document describes version 0.4.1-devel.1 of CCTests.