summaryrefslogtreecommitdiffstats
path: root/lldb/test
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test')
-rw-r--r--lldb/test/functionalities/completion/TestCompletion.py16
-rw-r--r--lldb/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py2
-rw-r--r--lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py6
-rw-r--r--lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py20
-rw-r--r--lldb/test/help/TestHelp.py9
5 files changed, 30 insertions, 23 deletions
diff --git a/lldb/test/functionalities/completion/TestCompletion.py b/lldb/test/functionalities/completion/TestCompletion.py
index 973bd3c93f0..1af0bb4d1a5 100644
--- a/lldb/test/functionalities/completion/TestCompletion.py
+++ b/lldb/test/functionalities/completion/TestCompletion.py
@@ -26,13 +26,17 @@ class CommandLineCompletionTestCase(TestBase):
"""Test that 'frame variable -w ' completes to ['Available completions:', 'read', 'write', 'read_write']."""
self.complete_from_to('frame variable -w ', ['Available completions:', 'read', 'write', 'read_write'])
- def test_watchpoint_set_dash_x(self):
- """Test that 'watchpoint set -x' completes to 'watchpoint set -x '."""
- self.complete_from_to('watchpoint set -x', 'watchpoint set -x ')
+ def test_watchpoint_set_ex(self):
+ """Test that 'watchpoint set ex' completes to 'watchpoint set expression '."""
+ self.complete_from_to('watchpoint set ex', 'watchpoint set expression ')
- def test_watchpoint_set_dash_w_read_underbar(self):
- """Test that 'watchpoint set -w read_' completes to 'watchpoint set -w read_write'."""
- self.complete_from_to('watchpoint set -w read_', 'watchpoint set -w read_write')
+ def test_watchpoint_set_var(self):
+ """Test that 'watchpoint set var' completes to 'watchpoint set variable '."""
+ self.complete_from_to('watchpoint set var', 'watchpoint set variable ')
+
+ def test_watchpoint_set_variable_dash_w_read_underbar(self):
+ """Test that 'watchpoint set variable -w read_' completes to 'watchpoint set variable -w read_write'."""
+ self.complete_from_to('watchpoint set variable -w read_', 'watchpoint set variable -w read_write')
def test_help_fi(self):
"""Test that 'help fi' completes to ['Available completions:', 'file', 'finish']."""
diff --git a/lldb/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py b/lldb/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
index cfc5f60e16e..1c0b90ed25f 100644
--- a/lldb/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
+++ b/lldb/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
@@ -75,7 +75,7 @@ class HelloWatchpointTestCase(TestBase):
substrs = ['Watchpoint created', 'size = 4', 'type = w',
'%s:%d' % (self.source, self.decl)])
else:
- self.expect("watchpoint set -w write -v global", WATCHPOINT_CREATED,
+ self.expect("watchpoint set variable -w write global", WATCHPOINT_CREATED,
substrs = ['Watchpoint created', 'size = 4', 'type = w',
'%s:%d' % (self.source, self.decl)])
diff --git a/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py b/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
index 74fc12a481e..14fcfb648b0 100644
--- a/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
+++ b/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
@@ -13,13 +13,13 @@ class WatchLocationUsingWatchpointSetTestCase(TestBase):
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
def test_watchlocation_with_dsym_using_watchpoint_set(self):
- """Test watching a location with 'watchpoint set -w write -x size' option."""
+ """Test watching a location with 'watchpoint set expression -w write -x size' option."""
self.buildDsym(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
self.watchlocation_using_watchpoint_set()
def test_watchlocation_with_dwarf_using_watchpoint_set(self):
- """Test watching a location with 'watchpoint set -w write -x size' option."""
+ """Test watching a location with 'watchpoint set expression -w write -x size' option."""
self.buildDwarf(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
self.watchlocation_using_watchpoint_set()
@@ -60,7 +60,7 @@ class WatchLocationUsingWatchpointSetTestCase(TestBase):
# with offset as 7.
# The main.cpp, by design, misbehaves by not following the agreed upon
# protocol of only accessing the allowable index range of [0, 6].
- self.expect("watchpoint set -w write -x 1 -e g_char_ptr + 7", WATCHPOINT_CREATED,
+ self.expect("watchpoint set expression -w write -x 1 -- g_char_ptr + 7", WATCHPOINT_CREATED,
substrs = ['Watchpoint created', 'size = 1', 'type = w'])
self.runCmd("expr unsigned val = g_char_ptr[7]; val")
self.expect(self.res.GetOutput().splitlines()[0], exe=False,
diff --git a/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py b/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
index 299e2aec9b6..5a390443c26 100644
--- a/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
+++ b/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
@@ -49,18 +49,20 @@ class WatchpointSetErrorTestCase(TestBase):
# Try some error conditions:
- # No argument is an error.
- self.expect("watchpoint set", error=True,
- startstr = 'error: invalid combination of options for the given command')
- self.runCmd("watchpoint set -v -w read_write", check=False)
+ # 'watchpoint set' is now a multiword command.
+ self.expect("watchpoint set",
+ substrs = ['The following subcommands are supported:',
+ 'expression',
+ 'variable'])
+ self.runCmd("watchpoint set variable -w read_write", check=False)
- # 'watchpoint set' now takes a mandatory '-v' or '-e' option to
- # indicate watching for either variable or address.
- self.expect("watchpoint set -w write global", error=True,
- startstr = 'error: invalid combination of options for the given command')
+ # 'watchpoint set expression' with '-w' or '-x' specified now needs
+ # an option terminator and a raw expression after that.
+ self.expect("watchpoint set expression -w write --", error=True,
+ startstr = 'error: required argument missing; specify an expression to evaulate into the addres to watch for')
# Wrong size parameter is an error.
- self.expect("watchpoint set -x -128", error=True,
+ self.expect("watchpoint set variable -x -128", error=True,
substrs = ['invalid enumeration value'])
diff --git a/lldb/test/help/TestHelp.py b/lldb/test/help/TestHelp.py
index 4fe0c77e246..57e67362fae 100644
--- a/lldb/test/help/TestHelp.py
+++ b/lldb/test/help/TestHelp.py
@@ -122,11 +122,12 @@ class HelpCommandTestCase(TestBase):
substrs = ['<watchpt-id-list>'])
def test_help_watchpoint_set(self):
- """Test that 'help watchpoint set' prints out <expr> for the '-e' option
- and <variable-name> for the '-v' option."""
+ """Test that 'help watchpoint set' prints out 'expression' and 'variable'
+ as the possible subcommands."""
self.expect("help watchpoint set",
- patterns = ['watchpoint set -e.*<expr>',
- 'watchpoint set -v.*<variable-name>'])
+ substrs = ['The following subcommands are supported:'],
+ patterns = ['expression +--',
+ 'variable +--'])
if __name__ == '__main__':
OpenPOWER on IntegriCloud