Fix double counting unit test failures:

Unit tests are counting test failures, process crashes, and process exit code
failures in the count. Since a failing tests causes the process exit code to
return failure, we get extra counts. This patch removes process exit code
failures from the count.
This commit is contained in:
seelabs
2020-12-04 11:32:25 -05:00
committed by Nik Bougalis
parent 183dcd08d9
commit b29812e40b

View File

@@ -297,6 +297,7 @@ runUnitTests(
boost::process::exe = exe_name, boost::process::args = args); boost::process::exe = exe_name, boost::process::args = args);
int bad_child_exits = 0; int bad_child_exits = 0;
int terminated_child_exits = 0;
for (auto& c : children) for (auto& c : children)
{ {
try try
@@ -309,10 +310,11 @@ runUnitTests(
{ {
// wait throws if process was terminated with a signal // wait throws if process was terminated with a signal
++bad_child_exits; ++bad_child_exits;
++terminated_child_exits;
} }
} }
parent_runner.add_failures(bad_child_exits); parent_runner.add_failures(terminated_child_exits);
anyMissing(parent_runner, multi_selector(pattern)); anyMissing(parent_runner, multi_selector(pattern));
if (parent_runner.any_failed() || bad_child_exits) if (parent_runner.any_failed() || bad_child_exits)