summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/packages/Python/lldbsuite/test/commands/log/invalid-args/TestInvalidArgsLog.py25
-rw-r--r--lldb/source/Commands/CommandObjectLog.cpp2
2 files changed, 27 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/commands/log/invalid-args/TestInvalidArgsLog.py b/lldb/packages/Python/lldbsuite/test/commands/log/invalid-args/TestInvalidArgsLog.py
new file mode 100644
index 00000000000..b45d1f345fd
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/commands/log/invalid-args/TestInvalidArgsLog.py
@@ -0,0 +1,25 @@
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+
+class InvalidArgsLogTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def setUp(self):
+ TestBase.setUp(self)
+
+ @no_debug_info_test
+ def test_enable_empty(self):
+ self.expect("log enable", error=True,
+ substrs=["error: log enable takes a log channel and one or more log types."])
+
+ @no_debug_info_test
+ def test_disable_empty(self):
+ self.expect("log disable", error=True,
+ substrs=["error: log disable takes a log channel and one or more log types."])
+
+ @no_debug_info_test
+ def test_timer_empty(self):
+ self.expect("log timer", error=True,
+ substrs=["error: Missing subcommand"])
diff --git a/lldb/source/Commands/CommandObjectLog.cpp b/lldb/source/Commands/CommandObjectLog.cpp
index ae8b175ef74..314405e0310 100644
--- a/lldb/source/Commands/CommandObjectLog.cpp
+++ b/lldb/source/Commands/CommandObjectLog.cpp
@@ -140,6 +140,7 @@ protected:
result.AppendErrorWithFormat(
"%s takes a log channel and one or more log types.\n",
m_cmd_name.c_str());
+ result.SetStatus(eReturnStatusFailed);
return false;
}
@@ -207,6 +208,7 @@ protected:
result.AppendErrorWithFormat(
"%s takes a log channel and one or more log types.\n",
m_cmd_name.c_str());
+ result.SetStatus(eReturnStatusFailed);
return false;
}
OpenPOWER on IntegriCloud