diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-04-29 18:45:17 +0300 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-04-29 18:51:00 +0300 |
commit | 221d00c4945c027b83d2ea72bc213e465d16884d (patch) | |
tree | 2c3e52b0b88e1c9ebb75debd61ec1f319b0cbcb5 /lib/pluginloader/test/pluginloader-load.cpp | |
parent | Cleanup (diff) | |
download | smolbote-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.cpp | 22 |
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; +} |