aboutsummaryrefslogtreecommitdiff
path: root/lib/smolblok/test/loader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/smolblok/test/loader.cpp')
-rw-r--r--lib/smolblok/test/loader.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/smolblok/test/loader.cpp b/lib/smolblok/test/loader.cpp
new file mode 100644
index 0000000..9e27a26
--- /dev/null
+++ b/lib/smolblok/test/loader.cpp
@@ -0,0 +1,25 @@
+#include "smolblok.hpp"
+#include <spdlog/spdlog.h>
+
+int main(int argc, char** argv)
+{
+ if(argc != 2) {
+ spdlog::error("usage: {} path/to/plugin.so", argv[0]);
+ return -1;
+ }
+
+ smolblok filter;
+ {
+ const auto r = filter.registerFormatPlugin("unused", argv[1]);
+ if(r.loaded) {
+ spdlog::info("Loaded plugin {}", argv[1]);
+ } else {
+ spdlog::error("Failed loading plugin {}", argv[1]);
+ spdlog::error(qUtf8Printable(r.error));
+ return -1;
+ }
+ }
+
+ return 0;
+}
+