Author: teemperor Date: Sun Sep 1 12:29:01 2019 New Revision: 370619 URL: http://llvm.org/viewvc/llvm-project?rev=370619&view=rev Log: [lldb] Test and fix invalid log command invocations
Added: lldb/trunk/packages/Python/lldbsuite/test/commands/log/invalid-args/ lldb/trunk/packages/Python/lldbsuite/test/commands/log/invalid-args/TestInvalidArgsLog.py Modified: lldb/trunk/source/Commands/CommandObjectLog.cpp Added: lldb/trunk/packages/Python/lldbsuite/test/commands/log/invalid-args/TestInvalidArgsLog.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/commands/log/invalid-args/TestInvalidArgsLog.py?rev=370619&view=auto ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/commands/log/invalid-args/TestInvalidArgsLog.py (added) +++ lldb/trunk/packages/Python/lldbsuite/test/commands/log/invalid-args/TestInvalidArgsLog.py Sun Sep 1 12:29:01 2019 @@ -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"]) Modified: lldb/trunk/source/Commands/CommandObjectLog.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectLog.cpp?rev=370619&r1=370618&r2=370619&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectLog.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectLog.cpp Sun Sep 1 12:29:01 2019 @@ -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; } _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits