Detect when a unit test child process crashes (RIPD-1592):

When a test suite starts and ends, it informs the parent process. If the parent
has received a start message without a matching end message it reports that a
child may have crashed in that suite.
This commit is contained in:
seelabs
2018-03-09 13:39:49 -05:00
parent deef322b07
commit 4b2afc8f42
7 changed files with 112 additions and 17 deletions

View File

@@ -229,9 +229,17 @@ static int runUnitTests(
int bad_child_exits = 0;
for(auto& c : children)
{
c.wait();
if (c.exit_code())
try
{
c.wait();
if (c.exit_code())
++bad_child_exits;
}
catch (...)
{
// wait throws if process was terminated with a signal
++bad_child_exits;
}
}
if (parent_runner.any_failed() || bad_child_exits)