FWIW I plan to support launching in a tty on Windows because it's so easy. In fact it'll probably be the default. Right now I launch in a separate terminal no matter what. So I guess I should say I plan to add support for *not* launching in a terminal :)<br><div><br></div><div>Minor nitpick, but as a matter of habit it would be good if we could avoid hardcoded paths in tests. Of course it's sometimes necessary, but it would be good to aim for pure test portability, even if the functionality being tested is not known to be portable. In the above test, for example, you might be able to fix this by using sys.executable instead of /bin/ls, and tempfile.gettempdir() instead of /tmp/</div><br><div class="gmail_quote">On Tue Jan 06 2015 at 11:19:51 AM Greg Clayton <<a href="mailto:gclayton@apple.com">gclayton@apple.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: gclayton<br>
Date: Tue Jan 6 13:17:58 2015<br>
New Revision: 225284<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=225284&view=rev" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project?rev=225284&view=rev</a><br>
Log:<br>
Added a test case for launching a process in a separate terminal window to ensure we don't regress on this.<br>
<br>
A recent POSIX host thread issue where HostThreadPosix::Join() wasn't returning the thread result was responsible for this regression, yet we had no test case covering this so it wasn't discovered.<br>
<br>
<br>
Added:<br>
lldb/trunk/test/<u></u>functionalities/tty/<br>
lldb/trunk/test/<u></u>functionalities/tty/<u></u>TestTerminal.py<br>
<br>
Added: lldb/trunk/test/<u></u>functionalities/tty/<u></u>TestTerminal.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/tty/TestTerminal.py?rev=225284&view=auto" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/lldb/trunk/test/<u></u>functionalities/tty/<u></u>TestTerminal.py?rev=225284&<u></u>view=auto</a><br>
==============================<u></u>==============================<u></u>==================<br>
--- lldb/trunk/test/<u></u>functionalities/tty/<u></u>TestTerminal.py (added)<br>
+++ lldb/trunk/test/<u></u>functionalities/tty/<u></u>TestTerminal.py Tue Jan 6 13:17:58 2015<br>
@@ -0,0 +1,35 @@<br>
+"""<br>
+Test lldb command aliases.<br>
+"""<br>
+<br>
+import os, time<br>
+import unittest2<br>
+import lldb<br>
+from lldbtest import *<br>
+import lldbutil<br>
+<br>
+class LaunchInTerminalTestCase(<u></u>TestBase):<br>
+<br>
+ mydir = TestBase.compute_mydir(__file_<u></u>_)<br>
+<br>
+ # Darwin is the only platform that I know of that supports optionally launching<br>
+ # a program in a separate terminal window. It would be great if other platforms<br>
+ # added support for this.<br>
+ @unittest2.skipUnless(sys.<u></u>platform.startswith("darwin"), "requires Darwin")<br>
+ def test_launch_in_terminal (self):<br>
+ exe = "/bin/ls"<br>
+ target = self.dbg.CreateTarget(exe)<br>
+ launch_info = lldb.SBLaunchInfo(["-lAF", "/tmp/"])<br>
+ launch_info.SetLaunchFlags(<u></u>lldb.eLaunchFlagLaunchInTTY)<br>
+ error = lldb.SBError()<br>
+ process = target.Launch (launch_info, error)<br>
+ self.assertTrue(error.Success(<u></u>), "Make sure launch happened successfully in a terminal window")<br>
+ # Running in synchronous mode our process should have run and already exited by the time target.Launch() returns<br>
+ self.assertTrue(process.<u></u>GetState() == lldb.eStateExited)<br>
+<br>
+if __name__ == '__main__':<br>
+ import atexit<br>
+ lldb.SBDebugger.Initialize()<br>
+ atexit.register(lambda: lldb.SBDebugger.Terminate())<br>
+ unittest2.main()<br>
+<br>
<br>
<br>
______________________________<u></u>_________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@cs.uiuc.edu" target="_blank">lldb-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/lldb-commits</a><br>
</blockquote></div>