<div dir="ltr">We could also then remove unittest2 from inclusion in the lldb repo.<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 22, 2015 at 11:28 AM, Todd Fiala <span dir="ltr"><<a href="mailto:todd.fiala@gmail.com" target="_blank">todd.fiala@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I'd be okay with that.<div><br></div><div>The unittest2 stuff looks like it was a vestige of being incorporated before unittest2 was stock (unitest) on Python 2.[6,7]?.  Everyone should have a unitest included that is effectively what we use as unittest2.</div><div><br></div><div>-Todd</div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Thu, Oct 22, 2015 at 10:05 AM, Zachary Turner via lldb-dev <span dir="ltr"><<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I plan to put this in today.  Greg, should I just go ahead and delete all the unittest2 stuff entirely?  TBH I'm all for anything that reduces the complexity of the test suite.  It's got a couple hundred options that nobody uses, seems like we should start whittling away at stuff that doesn't get any use.<div><br></div><div>If you prefer I leave it in that's less work for me since I have that patch ready to go, but TBH I'd rather remove it if that's ok.</div></div><div><div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 22, 2015 at 9:50 AM Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">You can get pretty much the same effect though by just running dotest and passing it the folder that the .py file is in.   Then it only runs tests in that folder.  You can specify the filename too if you want to limit it to one name.  Sure, it's a few keystrokes less to just type TestMultithreaded.py or something, but given the extra complexity and the fact that it's running a totally different codepath, I wonder if the maintenance burden is worth it (I'm guessing no, since apparently it doesn't work well enough right now for anyone to use it)</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 22, 2015 at 9:47 AM Greg Clayton <<a href="mailto:gclayton@apple.com" target="_blank">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">I believe it would import lldb correctly. I don't tend to run the tests individually, but if it did work, I would use it more.<br>
<br>
> On Oct 22, 2015, at 9:26 AM, Zachary Turner via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:<br>
><br>
> Todd, Greg, can you guys confirm this is true?   The import lldb would succeed if someone had their PYTHONPATH set up just right, but if really none of us care about it, I'm with Tamas in that I'd rather remove it.<br>
><br>
> On Thu, Oct 22, 2015 at 2:55 AM Tamas Berghammer <<a href="mailto:tberghammer@google.com" target="_blank">tberghammer@google.com</a>> wrote:<br>
> Hi Zach,<br>
><br>
> I think nobody is using the "if __name__ == '__main__'" block as executing a test file directly isn't working at the moment (the "import lldb" command fails). If you plan to change all test file then I would prefer to remove the reference to unittest2 from them for simplicity if nobody have an objection against it.<br>
><br>
> Tamas<br>
><br>
> On Wed, Oct 21, 2015 at 8:57 PM Zachary Turner via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:<br>
> TL;DR - Nobody has to do anything, this is just a heads up that a 400+ file CL is coming.<br>
><br>
> IANAL, but I've been told by one that I need to move all third party code used by LLDB to lldb/third_party.  Currently there is only one thing there: the Python `six` module used for creating code that is portable across Python 2 and Python 3.<br>
><br>
> The only other 2 instances that I'm aware of are pexpect and unittest2, which are under lldb/test.  I've got some patches locally which move pexpect and unittest2 to lldb/third_party.  I'll hold off on checking them in for a bit to give people a chance to see this message first, because otherwise you might be surprised when you see a CL with 400 files being checked in.<br>
><br>
> Nobody will have to do anything after this CL goes in, and everything should continue to work exactly as it currently does.<br>
><br>
> The main reason for the churn is that pretty much every single test in LLDB does something like this:<br>
><br>
> import unittest2<br>
><br>
> ...<br>
><br>
> if __name__ == '__main__':<br>
>     import atexit<br>
>     lldb.SBDebugger.Initialize()<br>
>     atexit.register(lambda: lldb.SBDebugger.Terminate())<br>
>     unittest2.main()<br>
><br>
> This worked when unittest2 was a subfolder of test, but not when it's somewhere else.  Since LLDB's python code is not organized into a standard python package and we treat the scripts like dotest etc as standalone scripts, the way I've made this work is by introducing a module called lldb_shared under test which, when you import it, fixes up sys.path to correctly add all the right locations under lldb/third_party.<br>
><br>
> So, every single test now needs a line at the top to import lldb_shared.<br>
><br>
> TBH I don't even know if we need this unittest2 stuff anymore (does anyone even use it?)  but even if the answer is no, then that still means changing every file to delete the import statement and the if __name__ == '__main__': block.<br>
><br>
> If there are no major concerns I plan to check this in by the end of the day, or tomorrow.<br>
> _______________________________________________<br>
> lldb-dev mailing list<br>
> <a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>
> _______________________________________________<br>
> lldb-dev mailing list<br>
> <a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>
<br>
</blockquote></div></blockquote></div>
</div></div><br>_______________________________________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div><div dir="ltr">-Todd</div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">-Todd</div></div>
</div>