<div dir="ltr">The current issue with regards to getting tests working on Windows is that the pexpect module doesn't exist on Windows. I've looked over a number of the tests, and as far as I can tell, the pexpect module is used for two primary reasons. The first is spawning lldb and waiting for it to terminate, and the second is sending text commands to lldb, and reading the textual results of these commands, comparing them against expected values.<div>
<br></div><div>#1 can be solved without pexpect (e.g. by using the subprocess module), but #2 is more difficult.</div><div><br></div><div>It seems to me like there are two paths forward for getting the test suite working on windows:</div>
<div><br></div><div>1) Port pexpect to Windows. I expect this to be difficult for the sole reason that it hasn't been done yet, so despite the fact Windows does provide a sufficiently rich API to do everything that pexpect does, something tells me that there are some subtle issues that make this a difficult problem.</div>
<div><br></div><div>2) Change LLDB, and the test suite, to not rely on pexpect. The entire problem seems to boil down to the fact that LLDB writes all of its output to stdout and reads all of its input to stdin. When a command completes, In CommandInterpreter::IOHandlerInputComplete, it calls this line:</div>
<div><br></div><div><div> io_handler.GetOutputStreamFile()->PutCString(output);</div></div><div><br></div><div>which ultimately resolves to a FILE* referring to stdout. What would it take to make this output stream configurable? I'm imagining, for example, a function that's exposed through the Python API that lets me write something like</div>
<div><br></div><div>lldb.SBDebugger.SetOutputStream(foo)</div><div><br></div><div>"foo" here could be a python object that simply collects output, and then the "expect" command on the Python side could just compare the expected value against this buffer.</div>
<div><br></div><div>With this we could completely remove all the pexpect dependencies.</div><div><br></div><div>Thoughts? Suggestions? Gotchas? </div></div>