summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/commands/command/script/welcome.py
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2019-09-01 09:12:37 +0000
committerRaphael Isemann <teemperor@gmail.com>2019-09-01 09:12:37 +0000
commit29872606d220420d53fde7cc5e3bea15f8da62e7 (patch)
tree47d7a82ccea48a6dd10a2d8ecb6b3c3127724131 /lldb/packages/Python/lldbsuite/test/commands/command/script/welcome.py
parentadfdcb9c2652aeee585b9005fd6c67be06af8ea9 (diff)
downloadbcm5719-llvm-29872606d220420d53fde7cc5e3bea15f8da62e7.tar.gz
bcm5719-llvm-29872606d220420d53fde7cc5e3bea15f8da62e7.zip
[lldb] Restructure test folders to match LLDB command hierarchy
Summary: As discussed on lldb-dev, this patch moves some LLDB tests into a hierarchy that more closely resembles the commands we use in the LLDB interpreter. This patch should only move tests that use the command interpreter and shouldn't touch any tests that primarily test the SB API. Reviewers: #lldb, jfb, JDevlieghere Reviewed By: #lldb, JDevlieghere Subscribers: dexonsmith, arphaman, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67033 llvm-svn: 370605
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/commands/command/script/welcome.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/commands/command/script/welcome.py53
1 files changed, 53 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/commands/command/script/welcome.py b/lldb/packages/Python/lldbsuite/test/commands/command/script/welcome.py
new file mode 100644
index 00000000000..0539d7c1721
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/commands/command/script/welcome.py
@@ -0,0 +1,53 @@
+from __future__ import print_function
+import lldb
+import sys
+
+
+class WelcomeCommand(object):
+
+ def __init__(self, debugger, session_dict):
+ pass
+
+ def get_short_help(self):
+ return "Just a docstring for welcome_impl\nA command that says hello to LLDB users"
+
+ def __call__(self, debugger, args, exe_ctx, result):
+ print('Hello ' + args + ', welcome to LLDB', file=result)
+ return None
+
+
+class TargetnameCommand(object):
+
+ def __init__(self, debugger, session_dict):
+ pass
+
+ def __call__(self, debugger, args, exe_ctx, result):
+ target = debugger.GetSelectedTarget()
+ file = target.GetExecutable()
+ print('Current target ' + file.GetFilename(), file=result)
+ if args == 'fail':
+ result.SetError('a test for error in command')
+
+ def get_flags(self):
+ return lldb.eCommandRequiresTarget
+
+
+def print_wait_impl(debugger, args, result, dict):
+ result.SetImmediateOutputFile(sys.stdout)
+ print('Trying to do long task..', file=result)
+ import time
+ time.sleep(1)
+ print('Still doing long task..', file=result)
+ time.sleep(1)
+ print('Done; if you saw the delays I am doing OK', file=result)
+
+
+def check_for_synchro(debugger, args, result, dict):
+ if debugger.GetAsync():
+ print('I am running async', file=result)
+ if debugger.GetAsync() == False:
+ print('I am running sync', file=result)
+
+
+def takes_exe_ctx(debugger, args, exe_ctx, result, dict):
+ print(str(exe_ctx.GetTarget()), file=result)
OpenPOWER on IntegriCloud