aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorAlexander Bluhm <[email protected]>2017-04-28 20:43:18 +0200
committerAlexander Bluhm <[email protected]>2017-04-28 21:21:59 +0200
commit8084a1198223e177ddcb7b734a23dca6629f8f47 (patch)
tree577d836fcd57853a78f43f43d2e36d0fdbbcf01a /src/tests
parent2abdfc5a2d75f1cd581235bb3955222b87dad1fc (diff)
Show OpenSSL error messages if test fails.
Call ERR_load_crypto_strings() during test initialization if the openssl provider is also tested. This gives human readable error messages.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/main.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tests/main.cpp b/src/tests/main.cpp
index c90aaec7b..19ddfb40f 100644
--- a/src/tests/main.cpp
+++ b/src/tests/main.cpp
@@ -30,6 +30,10 @@
#include <botan/auto_rng.h>
#endif
+#if defined(BOTAN_HAS_OPENSSL)
+ #include <botan/internal/openssl.h>
+#endif
+
namespace {
class Test_Runner : public Botan_CLI::Command
@@ -153,6 +157,12 @@ class Test_Runner : public Botan_CLI::Command
output() << " provider:" << provider;
pf.set(provider);
}
+#if defined(BOTAN_HAS_OPENSSL)
+ if(provider.empty() || provider == "openssl")
+ {
+ ERR_load_crypto_strings();
+ }
+#endif
std::unique_ptr<Botan::RandomNumberGenerator> rng;