[lldb] Test and fix invalid log command invocations

llvm-svn: 370619
This commit is contained in:
Raphael Isemann 2019-09-01 19:29:01 +00:00
parent d63ddee5ab
commit 434b81d0a2
2 changed files with 27 additions and 0 deletions

View File

@ -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"])

View File

@ -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;
}