TestDarwinNSLogOutput reimplements all the utility functions of the PexpectTestCase. The
test is also randomly failing for me when it tries to tear down the process after LLDB was already
closed.
This patch removes all the custom logic in this test and just uses the PExpectTest equivalents.
The only missing functionality that PExpectTest didn't have was checking for missing substrs
in command output (to test that one can disable the NSLog output), so I extended PExpectTest
for that.
I think a better approach would be to just eat the entire output until the next prompt, and them pattern match the output normally. We could even delegate to the "real" expect method to do that part. Something like this (untested) snippet should do it:
Another advantage of this would be that we would avoid waiting for the timeout in case the command does not produce the expected output (but it still terminates correctly, so we can match the next prompt).