summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/expression_command
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2016-11-03 23:42:09 +0000
committerJim Ingham <jingham@apple.com>2016-11-03 23:42:09 +0000
commit225621596b3f48ea69a48f4e4a9f2566a4b1ed4d (patch)
tree0eee18f76f323ca66f190e743d3802d0bf6b0e63 /lldb/packages/Python/lldbsuite/test/expression_command
parentffb75385c88465a6d50106625febeb9b659f37c4 (diff)
downloadbcm5719-llvm-225621596b3f48ea69a48f4e4a9f2566a4b1ed4d.tar.gz
bcm5719-llvm-225621596b3f48ea69a48f4e4a9f2566a4b1ed4d.zip
Don't access the process in expressions w/o checking that
the process exists. I also added some tests that crash before this fix, and work correctly after. <rdar://problem/29083321> llvm-svn: 285974
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/expression_command')
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/calculator_mode/TestCalculatorMode.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/calculator_mode/TestCalculatorMode.py b/lldb/packages/Python/lldbsuite/test/expression_command/calculator_mode/TestCalculatorMode.py
new file mode 100644
index 00000000000..46ea111bf03
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/calculator_mode/TestCalculatorMode.py
@@ -0,0 +1,27 @@
+"""
+Test calling an expression without a target.
+"""
+
+from __future__ import print_function
+
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestCalculatorMode(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+
+ def test__calculator_mode(self):
+ """Test calling expressions in the dummy target."""
+ self.expect("expression 11 + 22", "11 + 22 didn't get the expected result", substrs=["33"])
+ # Now try it with a specific language:
+ self.expect("expression -l c -- 11 + 22", "11 + 22 didn't get the expected result", substrs=["33"])
+
OpenPOWER on IntegriCloud