[Lldb-commits] [PATCH] D19690: Split out console and file writing cases in TestCommandScriptImmediateOutput

Francis Ricci via lldb-commits lldb-commits at lists.llvm.org
Tue May 3 09:37:39 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL268397: Split out console and file writing cases in TestCommandScriptImmediateOutput (authored by fjricci).

Changed prior to commit:
  http://reviews.llvm.org/D19690?vs=55619&id=56020#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D19690

Files:
  lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py

Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
===================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
@@ -24,17 +24,25 @@
     @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 @@
             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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19690.56020.patch
Type: text/x-patch
Size: 2784 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160503/c30becec/attachment.bin>


More information about the lldb-commits mailing list