<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Sep 19, 2016 at 2:02 PM Greg Clayton <<a href="mailto:gclayton@apple.com">gclayton@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="gmail_msg">
> • Separate testing tools<br class="gmail_msg">
> • One question that remains open is how to represent the complicated needs of a debugger in lit tests. Part a) above covers the trivial cases, but what about the difficult cases? In <a href="https://reviews.llvm.org/D24591" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D24591</a> a number of ideas were discussed. We started getting to this idea towards the end, about a separate tool which has an interface independent of the command line interface and which can be used to test. lldb-mi was mentioned. While I have serious concerns about lldb-mi due to its poorly written and tested codebase, I do agree in principle with the methodology. In fact, this is the entire philosophy behind lit as used with LLVM, clang, lld, etc.<br class="gmail_msg">
<br class="gmail_msg">
We have a public API... Why are we going to go and spend _any_ time on doing anything else? I just don't get it. What a waste of time. We have a public API. Lets use it. Not simple enough for people? Tough. Testing a debugger should be done using the public API except when we are actually trying to test the LLDB command line in pexpect like tests. Those and only those are fine to covert over to using LIT and use text scraping. But 95% of our testing should be done using the API that our IDEs use. Using MI? Please no.</blockquote><div><br></div><div>FWIW, I agree with you about mi.</div><div><br></div><div>That said, the public api is problematic. Here you've got an API which, once you do something to, is set in stone forever. And yet in order to test something, you have to add it to the API. So now, in order to test something, you have to make a permanent change to a public API that can never be undone.</div><div><br></div><div>It's also a public facing API, when a lot of the stuff we need to be able to look at and inspect is not really suitable for public consumption.</div><div><br></div><div>If something is a public API that can never be changed once it's added, then there should be an extremely strict review process in order to add something to it. It should be VERY HARD to modify (it's currently not, which is a debate for another day, but anyway...). And yet that's fundamentally incompatible with having tests be easy to write. When it's hard to add the thing you need to add in order to write the test, then it's hard to write the test.</div><div><br></div><div>Furthermore, with a system such as the one I proposed, you could even run tests with LLDB_DISABLE_PYTHON. IDK about you, but that would be *amazing* from my point of view. Even though I spent months making Python 3 work, I would be happy to burn it all with fire and go back to just Python 2 if we had a viable testing strategy.</div></div></div>