[PATCH] D43048: [lldb-test/WIP] Allow a way to test autocompletion

Jim Ingham via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 7 15:15:42 PST 2018


jingham added a comment.

The current auto-completer tests aren't interactive - they do exactly the same thing your command does, but from Python.  It's fine if you want to add tests but please don't remove the current tests since they directly test what the SB clients use.

This will only allow you to test some of the auto-completers, for instance you don't have symbols so you can't test the symbol completer.  But since the symbol commands in this lldb-test have some way to feed symbols in maybe you can crib that.  I think you'll also need to make a target and some other bits as well.  As you start adding these you might find that this becomes onerous, but that will be an interesting experiment.

You didn't get the HandleCompletion API quite right.  That's my fault this isn't well documented.  The way it works is that if all the potential matches share a common substring, then the 0th element of the result contains the common substring.  If there is no common substring, then the possible matches will be stored from element 1 on in the Results list.  If you want examples take a closer look at how the Python test does it.


https://reviews.llvm.org/D43048





More information about the llvm-commits mailing list