Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lldb/test] Add test for the scripting template list command #101726

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

medismailben
Copy link
Member

@medismailben medismailben commented Aug 2, 2024

This patch adds a shell test to verify the output of the scripting template list command as discussed in #101672

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 2, 2024

@llvm/pr-subscribers-lldb

Author: Med Ismail Bennani (medismailben)

Changes

This patch adds a shell test to verify the output of the scripting template list command.


Full diff: https://github.com/llvm/llvm-project/pull/101726.diff

1 Files Affected:

  • (added) lldb/test/Shell/Commands/command-scripting-template-list.test (+38)
diff --git a/lldb/test/Shell/Commands/command-scripting-template-list.test b/lldb/test/Shell/Commands/command-scripting-template-list.test
new file mode 100644
index 0000000000000..906f012618443
--- /dev/null
+++ b/lldb/test/Shell/Commands/command-scripting-template-list.test
@@ -0,0 +1,38 @@
+# REQUIRES: python
+# RUN: %lldb -s %s -o exit | FileCheck %s
+
+scripting template list
+# CHECK:Available scripted extension templates:
+# CHECK-NEXT:  Name: OperatingSystemPythonInterface
+# CHECK-NEXT:  Language: Python
+# CHECK-NEXT:  Description: Mock thread state
+# CHECK-NEXT:  API Usages: None
+# CHECK-NEXT:  Command Interpreter Usages:
+# CHECK-NEXT:    settings set target.process.python-os-plugin-path <script-path>
+# CHECK-NEXT:    settings set process.experimental.os-plugin-reports-all-threads [0/1]
+# CHECK-NEXT:  Name: ScriptedPlatformPythonInterface
+# CHECK-NEXT:  Language: Python
+# CHECK-NEXT:  Description: Mock platform and interact with its processes.
+# CHECK-NEXT:  API Usages: None
+# CHECK-NEXT:  Command Interpreter Usages: None
+# CHECK-NEXT:  Name: ScriptedProcessPythonInterface
+# CHECK-NEXT:  Language: Python
+# CHECK-NEXT:  Description: Mock process state
+# CHECK-NEXT:  API Usages:
+# CHECK-NEXT:    SBAttachInfo.SetScriptedProcessClassName
+# CHECK-NEXT:    SBAttachInfo.SetScriptedProcessDictionary
+# CHECK-NEXT:    SBTarget.Attach
+# CHECK-NEXT:    SBLaunchInfo.SetScriptedProcessClassName
+# CHECK-NEXT:    SBLaunchInfo.SetScriptedProcessDictionary
+# CHECK-NEXT:    SBTarget.Launch
+# CHECK-NEXT:  Command Interpreter Usages:
+# CHECK-NEXT:    process attach -C <script-name> [-k key -v value ...]
+# CHECK-NEXT:    process launch -C <script-name> [-k key -v value ...]
+# CHECK-NEXT:  Name: ScriptedThreadPlanPythonInterface
+# CHECK-NEXT:  Language: Python
+# CHECK-NEXT:  Description: Alter thread stepping logic and stop reason
+# CHECK-NEXT:  API Usages: SBThread.StepUsingScriptedThreadPlan
+# CHECK-NEXT:  Command Interpreter Usages: thread step-scripted -C <script-name> [-k key -v value ...]
+
+scripting template list -l lua
+# CHECK: Available scripted extension templates: None

This patch adds a shell test to verify the output of the `scripting
template list` command as discussed in llvm#101672.

Signed-off-by: Med Ismail Bennani <[email protected]>
Comment on lines +41 to +42
scripting template list -l lua
# CHECK: Available scripted extension templates: None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you get the same output regardless of whether you're building with or without lua support? If so then this is fine, otherwise this would have to go into a separate test that contains REQUIRES: lua.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I tested locally without Lua support.

@medismailben medismailben merged commit 737c387 into llvm:main Aug 2, 2024
4 of 5 checks passed
banach-space pushed a commit to banach-space/llvm-project that referenced this pull request Aug 7, 2024
adrian-prantl pushed a commit to adrian-prantl/llvm-project that referenced this pull request Oct 5, 2024
adrian-prantl pushed a commit to adrian-prantl/llvm-project that referenced this pull request Oct 11, 2024
adrian-prantl pushed a commit to adrian-prantl/llvm-project that referenced this pull request Oct 11, 2024
adrian-prantl pushed a commit to swiftlang/llvm-project that referenced this pull request Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants