19 #ifndef ASYLO_TEST_UTIL_EXEC_TESTER_H_ 20 #define ASYLO_TEST_UTIL_EXEC_TESTER_H_ 28 #include "absl/types/span.h" 31 namespace experimental {
43 ExecTester(
const std::vector<std::string> &args,
44 int fd_to_check = STDOUT_FILENO);
45 virtual ~ExecTester() =
default;
58 bool Run(
const std::string &input,
int *status);
72 static std::string BuildSiblingPath(
const std::string &path,
73 const std::string &file_name);
81 virtual bool CheckLine(
const std::string &line) {
return true; }
90 virtual bool FinalCheck(
bool accumulated) {
return accumulated; }
94 void RunWithAsserts(
const std::string &input,
bool *result,
int *status);
98 void DoExec(
int read_stdin,
int write_stdin,
int read_fd_to_check,
99 int write_fd_to_check);
106 void CheckFD(
int fd, absl::Span<
char> buffer, std::stringstream *linebuf,
111 void ReadCheckLoop(pid_t pid,
int fd,
bool *result,
int *status);
113 std::vector<std::string> args_;