diff options
author | lloyd <[email protected]> | 2010-07-28 13:44:36 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-07-28 13:44:36 +0000 |
commit | dc5fd3e18008b4dbad92e1e6f65ebec7e84d5533 (patch) | |
tree | b30ea67d81c1e69218cba5dc409c4bf32cddefcb /checks | |
parent | 06dbe9a68cf09213e1b63fecf8a91fe386508c63 (diff) |
Add new option --dyn-load to the check/selftest prog that will load
the named shared engine object.
Diffstat (limited to 'checks')
-rw-r--r-- | checks/check.cpp | 19 |
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 " |