summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbtest.py2
-rw-r--r--lldb/packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py17
2 files changed, 17 insertions, 2 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index adbd0ec369b..dd4651c9eff 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -2318,8 +2318,6 @@ FileCheck output:
with recording(self, trace) as sbuf:
print("looking at:", output, file=sbuf)
- if output is None:
- output = ""
# The heading says either "Expecting" or "Not expecting".
heading = "Expecting" if matching else "Not expecting"
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