X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fframework.cc;h=2c9ba74b4aebc346b40856eb51b358a4263077a0;hb=f00605dce4a482c8b19ef17c0e79c31238498522;hp=92aacfeea30a37f117efabfa514285b1ae9f50bb;hpb=19f4ac3359a324785d2c7f094d378cd4afa1b76e;p=awesomized%2Flibmemcached diff --git a/libtest/framework.cc b/libtest/framework.cc index 92aacfee..2c9ba74b 100644 --- a/libtest/framework.cc +++ b/libtest/framework.cc @@ -107,47 +107,50 @@ void Framework::exec() iter != _collection.end() and (_signal.is_shutdown() == false); ++iter) { - if (_only_run.empty() == false and - fnmatch(_only_run.c_str(), (*iter)->name(), 0)) + if (*iter) { - continue; - } - - _total++; + if (_only_run.empty() == false and + fnmatch(_only_run.c_str(), (*iter)->name(), 0)) + { + continue; + } - try { - switch ((*iter)->exec()) + _total++; + + try { + switch ((*iter)->exec()) + { + case TEST_FAILURE: + _failed++; + break; + + case TEST_SKIPPED: + _skipped++; + break; + + // exec() can return SUCCESS, but that doesn't mean that some tests did + // not fail or get skipped. + case TEST_SUCCESS: + _success++; + break; + } + } + catch (const libtest::fatal& e) { - case TEST_FAILURE: _failed++; - break; - - case TEST_SKIPPED: - _skipped++; - break; - - // exec() can return SUCCESS, but that doesn't mean that some tests did - // not fail or get skipped. - case TEST_SUCCESS: - _success++; - break; + stream::cerr(e.file(), e.line(), e.func()) << e.what(); + } + catch (const libtest::disconnected& e) + { + _failed++; + Error << "Unhandled disconnection occurred:" << e.what(); + throw; + } + catch (...) + { + _failed++; + throw; } - } - catch (const libtest::fatal& e) - { - _failed++; - stream::cerr(e.file(), e.line(), e.func()) << e.what(); - } - catch (const libtest::disconnected& e) - { - _failed++; - Error << "Unhandled disconnection occurred:" << e.what(); - throw; - } - catch (...) - { - _failed++; - throw; } }