> On Jan 31, 2019, at 10:42 AM, Pavel Labath via lldb-dev > <lldb-dev@lists.llvm.org> wrote: > > On 31/01/2019 19:26, Zachary Turner wrote: >> Was the test failing specifically in the keyboard handler for up arrow, or >> was it failing in the command history searching code? Because if it's the >> latter, then we could have a command which searches the command history. > > The patch is r351313, if you want to look at it in detail. But, I don't think > this one example matters too much, since we will always have some code which > deals with the interactivity of the terminal. That will need to be tested > somehow. > > Another example: we have a fairly complex piece of code that makes sure our > (lldb) prompt comes out in color. How do we write a test for that?
All the traffic back and forth with the terminal happens in the IOHandlerEditLine. We should be able to get our hands on the Debuggers IOHandler and feed characters directly to it, and read the results. So we should be able to write this kind of test by driving the debugger to whatever state you need with SB API and then just run one command and get the output string directly from the IOHandler. We should be able to then scan that output for color codes. I don't think we need an external process inspection tool to do this sort of thing. Jim > _______________________________________________ > lldb-dev mailing list > lldb-dev@lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev _______________________________________________ lldb-dev mailing list lldb-dev@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev