Author: ki.stfu Date: Tue Feb 10 22:51:41 2015 New Revision: 228801 URL: http://llvm.org/viewvc/llvm-project?rev=228801&view=rev Log: Close terminal after LaunchInTerminalTestCase test
Summary: The test_launch_in_terminal test leaves a running terminal. This patch adds "exit" after debugging with eLaunchFlagLaunchInTTY flag. Reviewers: jingham, zturner, clayborg Reviewed By: clayborg Subscribers: emaste, vharron, lldb-commits, clayborg, jingham, zturner Differential Revision: http://reviews.llvm.org/D7468 Modified: lldb/trunk/include/lldb/lldb-enumerations.h lldb/trunk/source/Host/macosx/Host.mm lldb/trunk/test/functionalities/tty/TestTerminal.py Modified: lldb/trunk/include/lldb/lldb-enumerations.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-enumerations.h?rev=228801&r1=228800&r2=228801&view=diff ============================================================================== --- lldb/trunk/include/lldb/lldb-enumerations.h (original) +++ lldb/trunk/include/lldb/lldb-enumerations.h Tue Feb 10 22:51:41 2015 @@ -52,6 +52,7 @@ namespace lldb { eLaunchFlagDetachOnError = (1u << 9), ///< If set, then the client stub should detach rather than killing the debugee ///< if it loses connection with lldb. eLaunchFlagGlobArguments = (1u << 10), ///< Glob arguments without going through a shell + eLaunchFlagCloseTTYOnExit = (1u << 11), ///< Close the open TTY on exit } LaunchFlags; //---------------------------------------------------------------------- Modified: lldb/trunk/source/Host/macosx/Host.mm URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=228801&r1=228800&r2=228801&view=diff ============================================================================== --- lldb/trunk/source/Host/macosx/Host.mm (original) +++ lldb/trunk/source/Host/macosx/Host.mm Tue Feb 10 22:51:41 2015 @@ -471,6 +471,8 @@ LaunchInNewTerminalWithAppleScript (cons command.Printf(" '%s'", exe_path); } command.PutCString (" ; echo Process exited with status $?"); + if (launch_info.GetFlags().Test(lldb::eLaunchFlagCloseTTYOnExit)) + command.PutCString (" ; exit"); StreamString applescript_source; Modified: lldb/trunk/test/functionalities/tty/TestTerminal.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/tty/TestTerminal.py?rev=228801&r1=228800&r2=228801&view=diff ============================================================================== --- lldb/trunk/test/functionalities/tty/TestTerminal.py (original) +++ lldb/trunk/test/functionalities/tty/TestTerminal.py Tue Feb 10 22:51:41 2015 @@ -30,7 +30,7 @@ class LaunchInTerminalTestCase(TestBase) exe = "/bin/ls" target = self.dbg.CreateTarget(exe) launch_info = lldb.SBLaunchInfo(["-lAF", "/tmp/"]) - launch_info.SetLaunchFlags(lldb.eLaunchFlagLaunchInTTY) + launch_info.SetLaunchFlags(lldb.eLaunchFlagLaunchInTTY | lldb.eLaunchFlagCloseTTYOnExit) error = lldb.SBError() process = target.Launch (launch_info, error) self.assertTrue(error.Success(), "Make sure launch happened successfully in a terminal window") _______________________________________________ lldb-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
