summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite
diff options
context:
space:
mode:
authorFrancis Ricci <francisjricci@gmail.com>2016-05-03 16:31:36 +0000
committerFrancis Ricci <francisjricci@gmail.com>2016-05-03 16:31:36 +0000
commit3cf8e16f44a4c41bd7458a6a6fbd04bc3d029e6f (patch)
tree97541b21b1dc6dd1994992dbea3f2c13a36c3062 /lldb/packages/Python/lldbsuite
parent4a304b3886e865155b55eb71d83a5da9bea85816 (diff)
downloadbcm5719-llvm-3cf8e16f44a4c41bd7458a6a6fbd04bc3d029e6f.tar.gz
bcm5719-llvm-3cf8e16f44a4c41bd7458a6a6fbd04bc3d029e6f.zip
Split out console and file writing cases in TestCommandScriptImmediateOutput
Summary: As these are really testing separate issues, they should be run as separate tests. Reviewers: zturner, granata.enrico, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D19690 llvm-svn: 268397
Diffstat (limited to 'lldb/packages/Python/lldbsuite')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py b/lldb/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
index 010dcfaca6d..8da22643f2a 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
@@ -24,17 +24,25 @@ class CommandScriptImmediateOutputTestCase (PExpectTest):
@skipIfRemote # test not remote-ready llvm.org/pr24813
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
@expectedFailureAll(oslist=["freebsd","linux"], bugnumber="llvm.org/pr26139")
- def test_command_script_immediate_output (self):
- """Test that LLDB correctly allows scripted commands to set an immediate output file."""
- self.launch(timeout=60)
+ def test_command_script_immediate_output_console (self):
+ """Test that LLDB correctly allows scripted commands to set immediate output to the console."""
+ self.launch(timeout=10)
script = os.path.join(os.getcwd(), 'custom_command.py')
prompt = "\(lldb\) "
-
+
self.sendline('command script import %s' % script, patterns=[prompt])
self.sendline('command script add -f custom_command.command_function mycommand', patterns=[prompt])
self.sendline('mycommand', patterns='this is a test string, just a test string')
self.sendline('command script delete mycommand', patterns=[prompt])
+ self.quit(gracefully=False)
+
+ @skipIfRemote # test not remote-ready llvm.org/pr24813
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(oslist=["freebsd","linux"], bugnumber="llvm.org/pr26139")
+ def test_command_script_immediate_output_file (self):
+ """Test that LLDB correctly allows scripted commands to set immediate output to a file."""
+ self.launch(timeout=10)
test_files = {os.path.join(os.getcwd(), 'read.txt') :'r',
os.path.join(os.getcwd(), 'write.txt') :'w',
@@ -50,6 +58,11 @@ class CommandScriptImmediateOutputTestCase (PExpectTest):
with open(path, 'w+') as init:
init.write(starter_string)
+ script = os.path.join(os.getcwd(), 'custom_command.py')
+ prompt = "\(lldb\) "
+
+ self.sendline('command script import %s' % script, patterns=[prompt])
+
self.sendline('command script add -f custom_command.write_file mywrite', patterns=[prompt])
for path, mode in test_files.iteritems():
command = 'mywrite "' + path + '" ' + mode
OpenPOWER on IntegriCloud