aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--checks/check.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/checks/check.cpp b/checks/check.cpp
index 476886661..74348402a 100644
--- a/checks/check.cpp
+++ b/checks/check.cpp
@@ -21,6 +21,10 @@
#include <botan/botan.h>
#include <botan/libstate.h>
+#if defined(BOTAN_HAS_DYNAMICALLY_LOADED_ENGINE)
+ #include <botan/dyn_engine.h>
+#endif
+
using namespace Botan;
#include "getopt.h"
@@ -98,7 +102,7 @@ int main(int argc, char* argv[])
{
try
{
- OptionParser opts("help|test|validate|"
+ OptionParser opts("help|test|validate|dyn-load=|"
"benchmark|bench-type=|bench-algo=|seconds=");
opts.parse(argv);
@@ -106,6 +110,19 @@ int main(int argc, char* argv[])
Botan::LibraryInitializer init("thread_safe=no");
+ if(opts.is_set("dyn-load"))
+ {
+ const std::string lib = opts.value("dyn-load");
+
+#if defined(BOTAN_HAS_DYNAMICALLY_LOADED_ENGINE)
+ global_state().algorithm_factory().add_engine(
+ new Dynamically_Loaded_Engine(lib));
+#else
+ std::cout << "Can't load " << lib
+ << "; DLL engines not supported in build\n";
+#endif
+ }
+
if(opts.is_set("help") || argc <= 1)
{
std::cerr << "Test driver for "