diff options
author | lloyd <[email protected]> | 2008-09-09 16:51:15 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-09-09 16:51:15 +0000 |
commit | 8ead00e737937d90343f0351a7e8baafacbf1327 (patch) | |
tree | 7e8efcac3d2fc44a6ad1e6e211d1640dc5f80cac /checks | |
parent | 49d089b666b2e6e6b2743adb8945f2a47a248139 (diff) |
Fix --bench-type
Diffstat (limited to 'checks')
-rw-r--r-- | checks/check.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/checks/check.cpp b/checks/check.cpp index 638b9e72c..047b8d051 100644 --- a/checks/check.cpp +++ b/checks/check.cpp @@ -122,7 +122,7 @@ int main(int argc, char* argv[]) { run_test_suite(); } - if(opts.is_set("bench-algo") || opts.is_set("benchmark")) + if(opts.is_set("bench-algo") || opts.is_set("benchmark") || opts.is_set("bench-type")) { double seconds = 1.5; @@ -137,22 +137,27 @@ int main(int argc, char* argv[]) } const bool html = opts.is_set("html"); - std::vector<std::string> algs = - Botan::split_on(opts.value("bench-algo"), ','); std::auto_ptr<RandomNumberGenerator> rng( RandomNumberGenerator::make_rng()); - for(u32bit j = 0; j != algs.size(); j++) + if(opts.is_set("benchmark")) { - const std::string alg = algs[j]; - u32bit found = bench_algo(alg, *rng, seconds); - if(!found) // maybe it's a PK algorithm - bench_pk(*rng, alg, html, seconds); + benchmark("All", *rng, html, seconds); } + else if(opts.is_set("bench-algo")) + { + std::vector<std::string> algs = + Botan::split_on(opts.value("bench-algo"), ','); - if(opts.is_set("benchmark")) - benchmark("All", *rng, html, seconds); + for(u32bit j = 0; j != algs.size(); j++) + { + const std::string alg = algs[j]; + u32bit found = bench_algo(alg, *rng, seconds); + if(!found) // maybe it's a PK algorithm + bench_pk(*rng, alg, html, seconds); + } + } else if(opts.is_set("bench-type")) { const std::string type = opts.value("bench-type"); @@ -171,6 +176,8 @@ int main(int argc, char* argv[]) benchmark("RNG", *rng, html, seconds); else if(type == "pk") bench_pk(*rng, "All", html, seconds); + else + std::cerr << "Unknown --bench-type " << type << "\n"; } } |