Author: ki.stfu Date: Tue Mar 3 09:17:44 2015 New Revision: 231071 URL: http://llvm.org/viewvc/llvm-project?rev=231071&view=rev Log: Improve MiStackTestCase tests
Summary: Improve MiStackTestCase tests. All tests pass on OS X. Reviewers: clayborg, abidh Reviewed By: clayborg Subscribers: lldb-commits, clayborg, abidh Differential Revision: http://reviews.llvm.org/D8004 Modified: lldb/trunk/test/tools/lldb-mi/stack/TestMiStack.py Modified: lldb/trunk/test/tools/lldb-mi/stack/TestMiStack.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/stack/TestMiStack.py?rev=231071&r1=231070&r2=231071&view=diff ============================================================================== --- lldb/trunk/test/tools/lldb-mi/stack/TestMiStack.py (original) +++ lldb/trunk/test/tools/lldb-mi/stack/TestMiStack.py Tue Mar 3 09:17:44 2015 @@ -197,13 +197,25 @@ class MiStackTestCase(lldbmi_testcase.Mi self.expect("\^running") self.expect("\*stopped,reason=\"breakpoint-hit\"") - # Test stack depth + # Test that -stack-info-depth works + # (and that max-depth is optional) self.runCmd("-stack-info-depth") self.expect("\^done,depth=\"[1-9]\"") + # Test that max-depth restricts check of stack depth + #FIXME: max-depth argument is ignored + self.runCmd("-stack-info-depth 1") + #self.expect("\^done,depth=\"1\"") + + # Test that invalid max-depth argument is handled + #FIXME: max-depth argument is ignored + self.runCmd("-stack-info-depth -1") + #self.expect("\^error") + @lldbmi_test @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races + @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_lldbmi_stack_info_frame(self): """Test that 'lldb-mi --interpreter' can show information about current frame.""" @@ -224,10 +236,23 @@ class MiStackTestCase(lldbmi_testcase.Mi self.expect("\^running") self.expect("\*stopped,reason=\"breakpoint-hit\"") - # Test that -stack-info-frame works when program is running + # Test that -stack-info-frame works when program was stopped on BP self.runCmd("-stack-info-frame") self.expect("\^done,frame=\{level=\"0\",addr=\".+\",func=\"main\",file=\"main\.cpp\",fullname=\".*main\.cpp\",line=\"\d+\"\}") + # Select frame #1 + self.runCmd("-stack-select-frame 1") + self.expect("\^done") + + # Test that -stack-info-frame works when specified frame was selected + self.runCmd("-stack-info-frame") + self.expect("\^done,frame=\{level=\"1\",addr=\".+\",func=\".+\",file=\"\?\?\",fullname=\"\?\?\",line=\"-1\"\}") + + # Test that -stack-info-frame fails when an argument is specified + #FIXME: unknown argument is ignored + self.runCmd("-stack-info-frame unknown_arg") + #self.expect("\^error") + @lldbmi_test @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races _______________________________________________ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits