88 lines · plain
1# This test validates the plugin enable and disable commands.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 shows the default state which is expected to be enabled.11plugin list12# CHECK-LABEL: plugin list13# CHECK: system-runtime14# CHECK: [+] systemruntime-macosx System runtime plugin for Mac OS X native libraries15 16# Test plugin disable disables a plugin.17plugin disable system-runtime.systemruntime-macosx18# CHECK-LABEL: plugin disable system-runtime.systemruntime-macosx19# CHECK: system-runtime20# CHECK: [-] systemruntime-macosx System runtime plugin for Mac OS X native libraries21 22# Make sure plugin list shows it disabled as well.23plugin list24# CHECK: system-runtime25# CHECK: [-] systemruntime-macosx System runtime plugin for Mac OS X native libraries26 27# Test plugin enable re-enables a plugin.28plugin enable system-runtime.systemruntime-macosx29# CHECK-LABEL: plugin enable system-runtime.systemruntime-macosx30# CHECK: system-runtime31# CHECK: [+] systemruntime-macosx System runtime plugin for Mac OS X native libraries32 33# Make sure plugin list shows it enabled as well.34plugin list35# CHECK: system-runtime36# CHECK: [+] systemruntime-macosx System runtime plugin for Mac OS X native libraries37 38# Test plugin disable with namespace works.39plugin disable system-runtime40# CHECK-LABEL: plugin disable system-runtime41# CHECK: system-runtime42# CHECK: [-] systemruntime-macosx System runtime plugin for Mac OS X native libraries43 44# Test plugin enable with namespace works.45plugin enable system-runtime46# CHECK-LABEL: plugin enable system-runtime47# CHECK: system-runtime48# CHECK: [+] systemruntime-macosx System runtime plugin for Mac OS X native libraries49 50# Test plugin enable/disable for instrumentation plugin works.51plugin enable instrumentation-runtime52# CHECK-LABEL: plugin enable instrumentation-runtime53# CHECK: instrumentation-runtime54# CHECK: [+] AddressSanitizer55plugin disable instrumentation-runtime56# CHECK-LABEL: plugin disable instrumentation-runtime57# CHECK: instrumentation-runtime58# CHECK: [-] AddressSanitizer59 60# Test plugin enable with multiple arguments.61plugin enable system-runtime instrumentation-runtime62# CHECK-LABEL: plugin enable system-runtime instrumentation-runtime63# CHECK: system-runtime64# CHECK: [+] systemruntime-macosx System runtime plugin for Mac OS X native libraries.65# CHECK: instrumentation-runtime66# CHECK: [+] AddressSanitizer AddressSanitizer instrumentation runtime plugin.67 68# Test plugin disable with multiple arguments.69plugin disable system-runtime instrumentation-runtime70# CHECK-LABEL: plugin disable system-runtime instrumentation-runtime71# CHECK: system-runtime72# CHECK: [-] systemruntime-macosx System runtime plugin for Mac OS X native libraries.73# CHECK: instrumentation-runtime74# CHECK: [-] AddressSanitizer AddressSanitizer instrumentation runtime plugin.75 76# Test plugin enable/disable for unknown plugin returns an error.77# RUN: %lldb -o "plugin enable some-plugin-that-does-not-exist" 2>&1 | FileCheck %s --check-prefix=ERROR_PLUGIN_NOT_FOUND78# RUN: %lldb -o "plugin disable some-plugin-that-does-not-exist" 2>&1 | FileCheck %s --check-prefix=ERROR_PLUGIN_NOT_FOUND79# RUN: %lldb -o "plugin enable system-runtime some-plugin-that-does-not-exist" 2>&1 | FileCheck %s --check-prefix=ERROR_PLUGIN_NOT_FOUND80# ERROR_PLUGIN_NOT_FOUND: error: Found no matching plugins81 82# Test plugin enable/disable requires a plugin name.83# RUN: %lldb -o "plugin enable" 2>&1 | FileCheck %s --check-prefix=ERROR_ARGUMENTS_ENABLE84# ERROR_ARGUMENTS_ENABLE: error: 'plugin enable' requires one or more arguments85 86# RUN: %lldb -o "plugin disable" 2>&1 | FileCheck %s --check-prefix=ERROR_ARGUMENTS_DISABLE87# ERROR_ARGUMENTS_DISABLE: error: 'plugin disable' requires one or more arguments88