summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2017-04-19 23:21:04 +0000
committerJim Ingham <jingham@apple.com>2017-04-19 23:21:04 +0000
commitaab5be050596d6423d1f48c89cb5e57321bc3931 (patch)
treeb622e2f19f88a96c9b2896dbe6e0341154bd6c00 /lldb/packages/Python/lldbsuite/test
parentaa0cec7d6dbe602af9e0f9f0bb89eb750856baf2 (diff)
downloadbcm5719-llvm-aab5be050596d6423d1f48c89cb5e57321bc3931.tar.gz
bcm5719-llvm-aab5be050596d6423d1f48c89cb5e57321bc3931.zip
Fix !N and !-N commands and add a test case.
<rdar://problem/31713267> llvm-svn: 300785
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/history/TestHistoryRecall.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/history/TestHistoryRecall.py b/lldb/packages/Python/lldbsuite/test/functionalities/history/TestHistoryRecall.py
new file mode 100644
index 00000000000..90bd64901ee
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/history/TestHistoryRecall.py
@@ -0,0 +1,45 @@
+"""
+Make sure the !N and !-N commands work properly.
+"""
+
+from __future__ import print_function
+
+
+import os
+import time
+import re
+import lldb
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
+
+
+class TestHistoryRecall(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ # If your test case doesn't stress debug info, the
+ # set this to true. That way it won't be run once for
+ # each debug info format.
+ NO_DEBUG_INFO_TESTCASE = True
+
+ def test_history_recall(self):
+ """Test the !N and !-N functionality of the command interpreter."""
+ self.sample_test()
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+
+ def sample_test(self):
+ interp = self.dbg.GetCommandInterpreter()
+ result = lldb.SBCommandReturnObject()
+ interp.HandleCommand("command history", result, True)
+ interp.HandleCommand("platform list", result, True)
+
+ interp.HandleCommand("!0", result, False)
+ self.assertTrue(result.Succeeded(), "!0 command did not work: %s"%(result.GetError()))
+ self.assertTrue("command history" in result.GetOutput(), "!0 didn't rerun command history")
+
+ interp.HandleCommand("!-1", result, False)
+ self.assertTrue(result.Succeeded(), "!-1 command did not work: %s"%(result.GetError()))
+ self.assertTrue("host:" in result.GetOutput(), "!-1 didn't rerun platform list.")
OpenPOWER on IntegriCloud