title: Googletest Explicit FAIL() in child process is not recognized
body: <h1>Does googletest support multiple processes in C++?</h1>
  <p>Documentation:
  <a href="https://github.com/google/googletest/blob/master/docs/advanced.md#explicit-success-and-failure" rel="nofollow noreferrer">https://github.com/google/googletest/blob/master/docs/advanced.md#explicit-success-and-failure</a></p>
  <h3>An example googletest... test:</h3>
  <pre><code>TEST_F(TCPConnectionTest, killServerDuringWrite) {
    pid_t childProcessID;
    switch (childProcessID = fork()) { //A somewhat elegant way to split into two processes
      case -1: break; //Something went wrong, should report error here
      case 0: { //Child process
        // Should be busy in a loop when parent process sends kill signal
        // Else, I want the test to report a fail so I am aware my test is not working properly
        FAIL() &lt;&lt; &quot;Shouldn't get to this line.&quot;; //Pipe in a message to FAIL()
        break; //Don't need because child process won't get here?
      }
      default:  { //Parent process
        // Some other code goes here, then send kill signal
        kill(childProcessID, SIGKILL);
        pid_t result; int status; //Used for getting result
        //Keep checking result until child process returns dead
        while (result &lt;= 0) result = waitpid(childProcessID, &amp;status, WNOHANG);
        EXPECT_GT(result, 0);
      }
    }
  }
  </code></pre>
  <h3>Test output:</h3>
  <pre><code>tcptests.cpp:722: Failure
  Failed
  Shouldn't get to this line.
  [       OK ] TCPConnectionTest.killServerDuringWrite (64 ms)
  [----------] 1 test from TCPConnectionTest (64 ms total)
  
  [----------] Global test environment tear-down
  [==========] 1 test from 1 test case ran. (64 ms total)
  [  PASSED  ] 1 test.
  </code></pre>
  <p>It seems that the child successfully sends the failure. At least, the string was piped in and sent to standard output. In the next line, the exits the switch, case statement and the process terminates.</p>
  <p><strong>Is the parent process unaware of failures reported in the child process?</strong></p>
  <p><em>(in all cases: child terminates, is sent a kill signal, or is still alive)</em></p>
  <ul>
  <li>Is this a limitation of the framework?</li>
  <li>Am I not using the framework properly?</li>
  <li>Is this where death tests are used?</li>
  </ul>
  <p><a href="https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#death-tests" rel="nofollow noreferrer">https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#death-tests</a></p>