diff options
Diffstat (limited to 'lldb/test')
-rw-r--r-- | lldb/test/functionalities/abbreviation/TestAbbreviations.py | 2 | ||||
-rw-r--r-- | lldb/test/functionalities/alias/TestAliases.py | 14 | ||||
-rw-r--r-- | lldb/test/functionalities/alias/py_import | 5 | ||||
-rw-r--r-- | lldb/test/functionalities/alias/welcome.py | 19 |
4 files changed, 29 insertions, 11 deletions
diff --git a/lldb/test/functionalities/abbreviation/TestAbbreviations.py b/lldb/test/functionalities/abbreviation/TestAbbreviations.py index 71add6f3881..31073af1e4e 100644 --- a/lldb/test/functionalities/abbreviation/TestAbbreviations.py +++ b/lldb/test/functionalities/abbreviation/TestAbbreviations.py @@ -34,7 +34,7 @@ class AbbreviationsTestCase(TestBase): startstr = "The following is a list of built-in, permanent debugger commands:") - self.expect("com s ./change_prompt.lldb", + self.expect("com sou ./change_prompt.lldb", patterns = ["Executing commands in '.*change_prompt.lldb'"]) self.expect("settings show prompt", diff --git a/lldb/test/functionalities/alias/TestAliases.py b/lldb/test/functionalities/alias/TestAliases.py index 4e700077e20..4f43136f24d 100644 --- a/lldb/test/functionalities/alias/TestAliases.py +++ b/lldb/test/functionalities/alias/TestAliases.py @@ -135,10 +135,10 @@ class AliasTestCase(TestBase): self.expect('welcome Enrico', substrs = ['Hello Enrico, welcome to LLDB']); - self.runCmd("command unalias welcome"); + self.runCmd("command script delete welcome"); self.expect('welcome Enrico', matching=False, error=True, - substrs = ['Hello Enrico, welcome to LLDB']); + substrs = ['Hello Enrico, welcome to LLDB']); self.expect('targetname', substrs = ['a.out']) @@ -146,7 +146,7 @@ class AliasTestCase(TestBase): self.expect('targetname fail', error=True, substrs = ['a test for error in command']) - self.expect('help', + self.expect('command script list', substrs = ['targetname', 'Run Python function target_name_impl']) @@ -155,6 +155,14 @@ class AliasTestCase(TestBase): 'This command takes \'raw\' input', 'quote stuff']) + self.expect("longwait", + substrs = ['Done; if you saw the delays I am doing OK']) + + self.runCmd("command script clear") + + self.expect('command script list', matching=False, + substrs = ['targetname', + 'longwait']) if __name__ == '__main__': import atexit diff --git a/lldb/test/functionalities/alias/py_import b/lldb/test/functionalities/alias/py_import index 5a562a2d997..9deba49e8f4 100644 --- a/lldb/test/functionalities/alias/py_import +++ b/lldb/test/functionalities/alias/py_import @@ -1,5 +1,6 @@ script import sys, os script sys.path.append(os.path.join(os.getcwd(), os.pardir)) script from welcome import * -command alias --python welcome welcome_impl -command alias --python targetname target_name_impl
\ No newline at end of file +command script add welcome --function welcome_impl +command script add targetname --function target_name_impl +command script add longwait --function print_wait_impl diff --git a/lldb/test/functionalities/alias/welcome.py b/lldb/test/functionalities/alias/welcome.py index 6754851c833..db90e89ee4e 100644 --- a/lldb/test/functionalities/alias/welcome.py +++ b/lldb/test/functionalities/alias/welcome.py @@ -1,14 +1,23 @@ import sys -def welcome_impl(debugger, args, stream, dict): - stream.Printf('Hello ' + args + ', welcome to LLDB'); +def welcome_impl(debugger, args, result, dict): + result.Printf('Hello ' + args + ', welcome to LLDB'); return None; -def target_name_impl(debugger, args, stream, dict): +def target_name_impl(debugger, args, result, dict): target = debugger.GetSelectedTarget() file = target.GetExecutable() - stream.Printf('Current target ' + file.GetFilename()) + result.PutCString('Current target ' + file.GetFilename()) if args == 'fail': return 'a test for error in command' else: - return None
\ No newline at end of file + return None + +def print_wait_impl(debugger, args, result, dict): + print 'Trying to do long task..'; + import time + time.sleep(1) + print 'Still doing long task..'; + time.sleep(1) + result.PutCString('Done; if you saw the delays I am doing OK') + return None
\ No newline at end of file |