diff options
Diffstat (limited to 'packages/Python/lldbsuite/test/help/TestHelp.py')
-rw-r--r-- | packages/Python/lldbsuite/test/help/TestHelp.py | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/packages/Python/lldbsuite/test/help/TestHelp.py b/packages/Python/lldbsuite/test/help/TestHelp.py index f51b6aa59f129..f4e9faff0edfa 100644 --- a/packages/Python/lldbsuite/test/help/TestHelp.py +++ b/packages/Python/lldbsuite/test/help/TestHelp.py @@ -10,7 +10,9 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil class HelpCommandTestCase(TestBase): @@ -80,7 +82,7 @@ class HelpCommandTestCase(TestBase): def test_help_version(self): """Test 'help version' and 'version' commands.""" self.expect("help version", - substrs = ['Show version of LLDB debugger.']) + substrs = ['Show the LLDB debugger version.']) version_str = self.version_number_string() import re match = re.match('[0-9]+', version_str) @@ -163,3 +165,49 @@ class HelpCommandTestCase(TestBase): substrs = ['The following subcommands are supported:'], patterns = ['expression +--', 'variable +--']) + + @no_debug_info_test + def test_help_po_hides_options(self): + """Test that 'help po' does not show all the options for expression""" + self.expect("help po", + substrs = ['--show-all-children', '--object-description'], matching=False) + + @no_debug_info_test + def test_help_run_hides_options(self): + """Test that 'help run' does not show all the options for process launch""" + self.expect("help run", + substrs = ['--arch', '--environment'], matching=False) + + @no_debug_info_test + def test_help_next_shows_options(self): + """Test that 'help next' shows all the options for thread step-over""" + self.expect("help next", + substrs = ['--python-class','--run-mode'], matching=True) + + @no_debug_info_test + def test_help_provides_alternatives(self): + """Test that help on commands that don't exist provides information on additional help avenues""" + self.expect("help thisisnotadebuggercommand", + substrs = ["'thisisnotadebuggercommand' is not a known command.", + "Try 'help' to see a current list of commands.", + "Try 'apropos thisisnotadebuggercommand' for a list of related commands.", + "Try 'type lookup thisisnotadebuggercommand' for information on types, methods, functions, modules, etc."], error=True) + + self.expect("help process thisisnotadebuggercommand", + substrs = ["'process thisisnotadebuggercommand' is not a known command.", + "Try 'help' to see a current list of commands.", + "Try 'apropos thisisnotadebuggercommand' for a list of related commands.", + "Try 'type lookup thisisnotadebuggercommand' for information on types, methods, functions, modules, etc."]) + + @no_debug_info_test + def test_custom_help_alias(self): + """Test that aliases pick up custom help text.""" + def cleanup(): + self.runCmd('command unalias afriendlyalias', check=False) + self.runCmd('command unalias averyfriendlyalias', check=False) + + self.addTearDownHook(cleanup) + self.runCmd('command alias --help "I am a friendly alias" -- afriendlyalias help') + self.expect("help afriendlyalias", matching=True, substrs = ['I am a friendly alias']) + self.runCmd('command alias --long-help "I am a very friendly alias" -- averyfriendlyalias help') + self.expect("help averyfriendlyalias", matching=True, substrs = ['I am a very friendly alias']) |