aboutsummaryrefslogtreecommitdiff
path: root/lib/pluginloader/test/pluginloader-load.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2020-04-29 18:45:17 +0300
committerAqua-sama <aqua@iserlohn-fortress.net>2020-04-29 18:51:00 +0300
commit221d00c4945c027b83d2ea72bc213e465d16884d (patch)
tree2c3e52b0b88e1c9ebb75debd61ec1f319b0cbcb5 /lib/pluginloader/test/pluginloader-load.cpp
parentCleanup (diff)
downloadsmolbote-221d00c4945c027b83d2ea72bc213e465d16884d.tar.xz
Expand pluginloader test coverage
- add poi-plugin-load to test compatibility of plugins - rewrite tests to use catch2 - use cpp stdlib to read files - clang-tidy and clang-format pass
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;
+}