Re: [Lldb-commits] [PATCH] D19690: Split out console and file writing cases in TestCommandScriptImmediateOutput
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 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 remot
Re: [Lldb-commits] [PATCH] D19690: Split out console and file writing cases in TestCommandScriptImmediateOutput
granata.enrico added a comment. LGTM http://reviews.llvm.org/D19690 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D19690: Split out console and file writing cases in TestCommandScriptImmediateOutput
fjricci updated this revision to Diff 55619. fjricci added a comment. Update timeout to 10 seconds for console case http://reviews.llvm.org/D19690 Files: packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py Index: packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py === --- packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py +++ 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 Index: packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py === --- packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py +++ 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_out
Re: [Lldb-commits] [PATCH] D19690: Split out console and file writing cases in TestCommandScriptImmediateOutput
granata.enrico accepted this revision. This revision is now accepted and ready to land. Comment at: packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py:29 @@ -30,1 +28,3 @@ +"""Test that LLDB correctly allows scripted commands to set immediate output to the console.""" +self.launch(timeout=5) fjricci wrote: > granata.enrico wrote: > > Can we raise this a little bit? I worry that going all the way from 60 down > > to 5 might cause this test to start failing more in load scenarios. Maybe > > 10 would be a better value? > I chose 5 because your original console unit test used 5. I changed it to 60 > when I added the file aspects. I don't have a problem changing it to 10 though 10 is probably fine - the file version also seems to use 10, so I'd just make them consistent. Other than that LGTM. http://reviews.llvm.org/D19690 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D19690: Split out console and file writing cases in TestCommandScriptImmediateOutput
fjricci added inline comments. Comment at: packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py:29 @@ -30,1 +28,3 @@ +"""Test that LLDB correctly allows scripted commands to set immediate output to the console.""" +self.launch(timeout=5) granata.enrico wrote: > Can we raise this a little bit? I worry that going all the way from 60 down > to 5 might cause this test to start failing more in load scenarios. Maybe 10 > would be a better value? I chose 5 because your original console unit test used 5. I changed it to 60 when I added the file aspects. I don't have a problem changing it to 10 though Comment at: packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py:43 @@ +42,3 @@ +@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.""" granata.enrico wrote: > Feel free to make the file version non pexpect-based if you want I ended up finding clayborg's sendline bug-fix, so pexpect should be fine (actually probably preferred) http://reviews.llvm.org/D19690 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D19690: Split out console and file writing cases in TestCommandScriptImmediateOutput
granata.enrico added inline comments. Comment at: packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py:29 @@ -30,1 +28,3 @@ +"""Test that LLDB correctly allows scripted commands to set immediate output to the console.""" +self.launch(timeout=5) Can we raise this a little bit? I worry that going all the way from 60 down to 5 might cause this test to start failing more in load scenarios. Maybe 10 would be a better value? Comment at: packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py:43 @@ +42,3 @@ +@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.""" Feel free to make the file version non pexpect-based if you want http://reviews.llvm.org/D19690 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D19690: Split out console and file writing cases in TestCommandScriptImmediateOutput
fjricci created this revision. fjricci added reviewers: zturner, granata.enrico, clayborg. fjricci added a subscriber: lldb-commits. As these are really testing separate issues, they should be run as separate tests. http://reviews.llvm.org/D19690 Files: packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py Index: packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py === --- packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py +++ 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=5) 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 Index: packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py === --- packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py +++ 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=5) 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(osl