83 lines · plain
1# This test validates the plugin list command.2# Currently it works only for system-runtime plugins and we only have one3# system runtime plugin so testing is a bit limited.4#5# Note that commands that return errors will stop running a script, so we6# have new RUN lines for any command that is expected to return an error.7 8# RUN: %lldb -s %s -o exit 2>&1 | FileCheck %s9 10# Test plugin list without an argument will list all plugins.11plugin list12# CHECK-LABEL: plugin list13# CHECK-DAG: instrumentation-runtime14# CHECK-DAG: [+] AddressSanitizer AddressSanitizer instrumentation runtime plugin.15# CHECK-DAG: system-runtime16# CHECK-DAG: [+] systemruntime-macosx System runtime plugin for Mac OS X native libraries17 18# Test plugin list works with fully qualified name.19plugin list system-runtime.systemruntime-macosx20# CHECK-LABEL: plugin list system-runtime.systemruntime-macosx21# CHECK: system-runtime22# CHECK: [+] systemruntime-macosx System runtime plugin for Mac OS X native libraries23 24# Test plugin list on plugin namespace works.25plugin list system-runtime26# CHECK-LABEL: plugin list system-runtime27# CHECK: system-runtime28# CHECK: [+] systemruntime-macosx System runtime plugin for Mac OS X native libraries29 30# Test plugin list on multiple args works.31plugin list system-runtime instrumentation-runtime.AddressSanitizer32# CHECK-LABEL: plugin list system-runtime instrumentation-runtime.AddressSanitizer33# CHECK: system-runtime34# CHECK: [+] systemruntime-macosx System runtime plugin for Mac OS X native libraries35# CHECK: instrumentation-runtime36# CHECK: [+] AddressSanitizer AddressSanitizer instrumentation runtime plugin.37 38# Test json output for plugin list.39plugin list --json40# CHECK-LABEL plugin list --json41# CHECK: {42# CHECK-DAG: "instrumentation-runtime":43# CHECK-DAG: "system-runtime":44# CHECK: }45 46# Test json output for plugin list with a namespace47plugin list system-runtime --json48# CHECK-LABEL plugin list --json49# CHECK: {50# CHECK: "system-runtime": [51# CHECK: {52# CHECK-DAG: "enabled": true53# CHECK-DAG: "name": "systemruntime-macosx"54# CHECK: }55# CHECK: ]56# CHECK: }57 58# Test json output for listing multiple plugins59plugin list --json system-runtime instrumentation-runtime.AddressSanitizer60# CHECK-LABEL plugin list --json system-runtime instrumentation-runtime.AddressSanitizer61# CHECK: {62# CHECK-DAG: "instrumentation-runtime":63# CHECK-DAG: "name": "AddressSanitizer"64# CHECK-DAG: "system-runtime":65# CHECK: }66 67 68# Test plugin list does not match a plugin name by substring.69# RUN: %lldb -o "plugin list macosx" 2>&1 | FileCheck %s --check-prefix=ERROR_PLUGIN_NOT_FOUND70 71# Test plugin list does not match a plugin namespace by substring.72# RUN: %lldb -o "plugin list system-runtime." 2>&1 | FileCheck %s --check-prefix=ERROR_PLUGIN_NOT_FOUND73 74# Test plugin list returns an error for unknown second argument75# RUN: %lldb -o "plugin list system-runtime foo" 2>&1 | FileCheck %s --check-prefix=ERROR_PLUGIN_NOT_FOUND76 77# Test plugin list returns an error for unknown second argument78# RUN: %lldb -o "plugin list --json system-runtime foo" 2>&1 | FileCheck %s --check-prefix=ERROR_PLUGIN_NOT_FOUND79 80# Test plugin list for unknown plugin returns an error.81# RUN: %lldb -o "plugin list some-plugin-that-does-not-exist" 2>&1 | FileCheck %s --check-prefix=ERROR_PLUGIN_NOT_FOUND82# ERROR_PLUGIN_NOT_FOUND: error: Found no matching plugins83