diff options
author | Alexander Bluhm <[email protected]> | 2017-03-31 21:14:04 +0200 |
---|---|---|
committer | Alexander Bluhm <[email protected]> | 2017-03-31 22:00:08 +0200 |
commit | 4ef2264389c6102577d63a26cc80857df1ead5d5 (patch) | |
tree | 921e36ab6e5ae71c4b3e49384c72f66a0450f59a /src | |
parent | 6ca6c87b31d8ac8cd6511adaf2061250857d799c (diff) |
Check name of test suite.
If botan-test is invoked with an invalid test name, fail with a
usage error. This is more obvious than not running the test.
Diffstat (limited to 'src')
-rw-r--r-- | src/tests/main.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tests/main.cpp b/src/tests/main.cpp index 4248de56b..93ab4feb2 100644 --- a/src/tests/main.cpp +++ b/src/tests/main.cpp @@ -123,6 +123,17 @@ class Test_Runner : public Botan_CLI::Command req = {"pkcs11-manage", "pkcs11-module", "pkcs11-slot", "pkcs11-session", "pkcs11-object", "pkcs11-rsa", "pkcs11-ecdsa", "pkcs11-ecdh", "pkcs11-rng", "pkcs11-x509"}; } + else + { + std::set<std::string> all = Botan_Tests::Test::registered_tests(); + for(auto&& r : req) + { + if(all.find(r) == all.end()) + { + throw Botan_CLI::CLI_Usage_Error("Unknown test suite: " + r); + } + } + } output() << "Testing " << Botan::version_string() << "\n"; output() << "Starting tests"; |