class ForkHelper
Defined at line 67 of file ../../src/starnix/tests/syscalls/cpp/test_helper.h
Helper class to handle test that needs to fork and do assertion on the child
process.
Public Methods
void ForkHelper ()
Defined at line 120 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
void ~ForkHelper ()
Defined at line 126 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
testing::AssertionResult WaitForChildren ()
Wait for all children of the current process, and return true if all exited
with a 0 status or with the expected signal.
Defined at line 141 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
ForkResult WaitForChild (pid_t child_pid)
Wait for a specific child of the current process, and return results on it.
Defined at line 152 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
std::vector<ForkResult> WaitForChildrenWithResults ()
Wait for all children of the current process, and return results on each.
Defined at line 175 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
pid_t RunInForkedProcess (fit::function<void ()> action)
For the current process and execute the given |action| inside the child,
then exit with a status equals to the number of failed expectation and
assertion. Return immediately with the pid of the child.
Defined at line 179 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
void ExpectSignal (int signum)
If called, checks for process termination by the given signal, instead of expecting
the forked process to terminate normally.
Defined at line 137 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
void ExpectExitValue (int value)
If called, checks for process termination with the given exit value,
instead of expecting the forked process to terminate normally.
Defined at line 139 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
void OnlyWaitForForkedChildren ()
If called, only waits for the children explicitly forked by the ForkHelper, instead
of waiting for all children.
Defined at line 135 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc