aboutsummaryrefslogtreecommitdiff
path: root/lib/pluginloader/test/pluginloader-load.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pluginloader/test/pluginloader-load.cpp')
-rw-r--r--lib/pluginloader/test/pluginloader-load.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/pluginloader/test/pluginloader-load.cpp b/lib/pluginloader/test/pluginloader-load.cpp
new file mode 100644
index 0000000..9c329a3
--- /dev/null
+++ b/lib/pluginloader/test/pluginloader-load.cpp
@@ -0,0 +1,22 @@
+#include "pluginloader.h"
+#include <spdlog/spdlog.h>
+
+int main(int argc, char **argv)
+{
+ if(argc != 2) {
+ spdlog::error("usage: {} path/to/plugin.so", argv[0]);
+ return -1;
+ }
+
+ const auto state = PluginLoader::signature_state(false, true, false);
+ PluginLoader loader(argv[1], state);
+ if(loader.load()) {
+ spdlog::info("Loaded plugin {}", argv[1]);
+ } else {
+ spdlog::error("Failed loading plugin {}", argv[1]);
+ spdlog::error(qUtf8Printable(loader.errorString()));
+ return -1;
+ }
+
+ return 0;
+}