#include "test/test_child_launcher.h"
#include <sys/resource.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <string>
#include <string_view>
#include <vector>
#include "reference_drivers/handle_eintr.h"
#include "test/multinode_test.h"
#include "testing/multiprocess_func_list.h"
#include "third_party/abseil-cpp/absl/base/macros.h"
#include "third_party/abseil-cpp/absl/strings/str_cat.h"
#include "util/safe_math.h"
namespace ipcz::test {
namespace {
constexpr std::string_view kTestChildProcess = …;
constexpr std::string_view kSocketFd = …;
using ArgList = std::vector<std::string>;
ArgList& GetArgList() { … }
std::string& GetTestNodeName() { … }
reference_drivers::FileDescriptor& GetSocketFd() { … }
template <typename ValueType>
std::string MakeSwitch(std::string_view name, ValueType value) { … }
std::vector<char*> MakeExecArgv(ArgList& args) { … }
int GetMaxFds() { … }
}
TestChildLauncher::TestChildLauncher() = default;
TestChildLauncher::~TestChildLauncher() = default;
void TestChildLauncher::Initialize(int argc, char** argv) { … }
bool TestChildLauncher::RunTestChild(int& exit_code) { … }
reference_drivers::FileDescriptor
TestChildLauncher::TakeChildSocketDescriptor() { … }
bool TestChildLauncher::WaitForSuccessfulProcessTermination(pid_t pid) { … }
pid_t TestChildLauncher::Launch(std::string_view node_name,
std::string_view feature_set,
reference_drivers::FileDescriptor socket) { … }
}