diff options
author | Jack Lloyd <[email protected]> | 2017-10-29 13:40:45 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-10-29 14:02:40 -0400 |
commit | 44d5d6a7e74a45f717cfedddc0d6186f182066de (patch) | |
tree | 8b0a0286bdb7cde17a5879f531def6eefd261791 /src/tests/tests.h | |
parent | 1007ab45750e4ebfd7c9bfe96efb39b7a1323226 (diff) |
Use a simple PRNG for the tests
Not cryptographically secure, but fast! Cuts several seconds off
the test suite even on a very fast machine. Probably even more
effective for 32-bit systems since the default for HMAC_DRBG is
SHA-384. Also it means deterministic tests are used regardless
of build configuration which is nice.
Improve output for --test-runs which was useful for me when
debugging SM2 encryption issue.
Diffstat (limited to 'src/tests/tests.h')
-rw-r--r-- | src/tests/tests.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/tests/tests.h b/src/tests/tests.h index fdbd080f4..9ab8e43b8 100644 --- a/src/tests/tests.h +++ b/src/tests/tests.h @@ -353,8 +353,9 @@ class Test Registration(const std::string& name, Test* test); }; - virtual std::vector<Test::Result> run() = 0; virtual ~Test() = default; + virtual std::vector<Test::Result> run() = 0; + virtual std::vector<std::string> possible_providers(const std::string&); static std::map<std::string, std::unique_ptr<Test>>& global_registry(); @@ -395,13 +396,14 @@ class Test return r; } - static void setup_tests(bool log_success, - bool run_online_tests, - bool run_long_tests, - const std::string& data_dir, - const std::string& pkcs11_lib, - const Botan_Tests::Provider_Filter& pf, - Botan::RandomNumberGenerator* rng); + static void set_test_options(bool log_success, + bool run_online_tests, + bool run_long_tests, + const std::string& data_dir, + const std::string& pkcs11_lib, + const Botan_Tests::Provider_Filter& pf); + + static void set_test_rng(std::unique_ptr<Botan::RandomNumberGenerator> rng); static bool log_success(); static bool run_online_tests(); @@ -417,7 +419,7 @@ class Test private: static std::string m_data_dir; - static Botan::RandomNumberGenerator* m_test_rng; + static std::unique_ptr<Botan::RandomNumberGenerator> m_test_rng; static bool m_log_success, m_run_online_tests, m_run_long_tests; static std::string m_pkcs11_lib; static Botan_Tests::Provider_Filter m_provider_filter; |