summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py b/lldb/packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py
index 7703d20ed41..a920ce845b8 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py
@@ -12,6 +12,7 @@ from lldbsuite.test import lldbutil
class CommandInterpreterAPICase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
def setUp(self):
# Call super's setUp().
@@ -72,3 +73,19 @@ class CommandInterpreterAPICase(TestBase):
if self.TraceOn():
lldbutil.print_stacktraces(process)
+
+ @add_test_categories(['pyapi'])
+ def test_command_output(self):
+ """Test command output handling."""
+ ci = self.dbg.GetCommandInterpreter()
+ self.assertTrue(ci, VALID_COMMAND_INTERPRETER)
+
+ # Test that a command which produces no output returns "" instead of
+ # None.
+ res = lldb.SBCommandReturnObject()
+ ci.HandleCommand("settings set use-color false", res)
+ self.assertTrue(res.Succeeded())
+ self.assertIsNotNone(res.GetOutput())
+ self.assertEquals(res.GetOutput(), "")
+ self.assertIsNotNone(res.GetError())
+ self.assertEquals(res.GetError(), "")
OpenPOWER on IntegriCloud