aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_runner.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-10-24 13:58:41 -0400
committerJack Lloyd <[email protected]>2017-10-24 13:59:34 -0400
commitc2830ddf08b41a9f5f2a472e0cc488c9c358fdb2 (patch)
tree02799f4ca7da4fdf34068f95c472424a796a7063 /src/tests/test_runner.cpp
parent7edec05c6056ab890a70eaf9f5c7a73321581ede (diff)
Inline Test::run_test into only caller
Diffstat (limited to 'src/tests/test_runner.cpp')
-rw-r--r--src/tests/test_runner.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/tests/test_runner.cpp b/src/tests/test_runner.cpp
index 8d3fe7558..9abf43795 100644
--- a/src/tests/test_runner.cpp
+++ b/src/tests/test_runner.cpp
@@ -298,16 +298,32 @@ size_t Test_Runner::run_tests(const std::vector<std::string>& tests_to_run)
for(auto const& test_name : tests_to_run)
{
+ output() << test_name << ':' << std::endl;
+
+ std::vector<Test::Result> results;
+
try
{
- output() << test_name << ':' << std::endl;
- const auto results = Botan_Tests::Test::run_test(test_name, false);
- output() << report_out(results, tests_failed, tests_ran) << std::flush;
+ if(Test* test = Test::get_test(test_name))
+ {
+ std::vector<Test::Result> test_results = test->run();
+ results.insert(results.end(), test_results.begin(), test_results.end());
+ }
+ else
+ {
+ results.push_back(Test::Result::Note(test_name, "Test missing or unavailable"));
+ }
}
catch(std::exception& e)
{
- output() << "Test " << test_name << " failed with exception " << e.what() << std::flush;
+ results.push_back(Test::Result::Failure(test_name, e.what()));
+ }
+ catch(...)
+ {
+ results.push_back(Test::Result::Failure(test_name, "unknown exception"));
}
+
+ output() << report_out(results, tests_failed, tests_ran) << std::flush;
}
const uint64_t total_ns = Botan_Tests::Test::timestamp() - start_time;