Import/Merge of libtest latest.
[m6w6/libmemcached] / libtest / framework.cc
index ea7ca66505e79af9811da02b3701f854c772f151..daea4f4ebfa339edd0d88f3847fe30e5dfbcc999 100644 (file)
@@ -84,7 +84,7 @@ Framework::~Framework()
 
   for (std::vector<Collection*>::iterator iter= _collection.begin();
        iter != _collection.end();
-       iter++)
+       ++iter)
   {
     delete *iter;
   }
@@ -104,7 +104,7 @@ void Framework::exec()
 {
   for (std::vector<Collection*>::iterator iter= _collection.begin();
        iter != _collection.end() and (_signal.is_shutdown() == false);
-       iter++)
+       ++iter)
   {
     if (_only_run.empty() == false and
         fnmatch(_only_run.c_str(), (*iter)->name(), 0))
@@ -134,13 +134,20 @@ void Framework::exec()
     }
     catch (libtest::fatal& e)
     {
+      _failed++;
       stream::cerr(e.file(), e.line(), e.func()) << e.mesg();
     }
     catch (libtest::disconnected& e)
     {
+      _failed++;
       Error << "Unhandled disconnection occurred:" << e.what();
       throw;
     }
+    catch (...)
+    {
+      _failed++;
+      throw;
+    }
 
     Outn();
   }
@@ -151,7 +158,7 @@ uint32_t Framework::sum_total()
   uint32_t count= 0;
   for (std::vector<Collection*>::iterator iter= _collection.begin();
        iter != _collection.end();
-       iter++)
+       ++iter)
   {
     count+= (*iter)->total();
   }
@@ -164,7 +171,7 @@ uint32_t Framework::sum_success()
   uint32_t count= 0;
   for (std::vector<Collection*>::iterator iter= _collection.begin();
        iter != _collection.end();
-       iter++)
+       ++iter)
   {
     count+= (*iter)->success();
   }
@@ -177,7 +184,7 @@ uint32_t Framework::sum_skipped()
   uint32_t count= 0;
   for (std::vector<Collection*>::iterator iter= _collection.begin();
        iter != _collection.end();
-       iter++)
+       ++iter)
   {
     count+= (*iter)->skipped();
   }
@@ -190,7 +197,7 @@ uint32_t Framework::sum_failed()
   uint32_t count= 0;
   for (std::vector<Collection*>::iterator iter= _collection.begin();
        iter != _collection.end();
-       iter++)
+       ++iter)
   {
     count+= (*iter)->failed();
   }