Skip to content

Commit

Permalink
Close terminal after LaunchInTerminalTestCase test
Browse files Browse the repository at this point in the history
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

llvm-svn: 228801
  • Loading branch information
k15tfu committed Feb 11, 2015
1 parent 3bd47ce commit 81b5c66
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions lldb/include/lldb/lldb-enumerations.h
Expand Up @@ -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;

//----------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions lldb/source/Host/macosx/Host.mm
Expand Up @@ -471,6 +471,8 @@ repeat with the_window in (get windows)\n\
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;

Expand Down
2 changes: 1 addition & 1 deletion lldb/test/functionalities/tty/TestTerminal.py
Expand Up @@ -30,7 +30,7 @@ def test_launch_in_terminal (self):
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")
Expand Down

0 comments on commit 81b5c66

Please sign in to comment.