| 56 | |
| 57 | |
| 58 | void run_subprocess(const lambda::function<Try<Subprocess>()>& createSubprocess) |
| 59 | { |
| 60 | Try<Subprocess> s = createSubprocess(); |
| 61 | |
| 62 | ASSERT_SOME(s); |
| 63 | |
| 64 | // Advance time until the internal reaper reaps the subprocess. |
| 65 | Clock::pause(); |
| 66 | while (s->status().isPending()) { |
| 67 | Clock::advance(MAX_REAP_INTERVAL()); |
| 68 | Clock::settle(); |
| 69 | } |
| 70 | Clock::resume(); |
| 71 | |
| 72 | // Check process exited cleanly. |
| 73 | AWAIT_EXPECT_WEXITSTATUS_EQ(0, s->status()); |
| 74 | } |
| 75 | |
| 76 | |
| 77 | // Calls subprocess, pipes output to an open file descriptor (and specifically |
no test coverage detected