Refactor out item specific bits of the testing framework.
[m6w6/libmemcached] / libtest / main.cc
index a5d90462582ca3653d73f4cd95aa4fd6e3d96597..dcbc50eb536879392b1bfa6ce9b1a373d299128e 100644 (file)
@@ -310,39 +310,32 @@ int main(int argc, char *argv[])
             {
               if (test_success(return_code= world.item.flush(creators_ptr, run)))
               {
-                // @note pre will fail is SKIPPED is returned
-                if (test_success(return_code= world.item.pre(creators_ptr)))
-                {
-                  { // Runner Code
-                    gettimeofday(&start_time, NULL);
-                    assert(world.runner());
-                    assert(run->test_fn);
-                    try 
+                { // Runner Code
+                  gettimeofday(&start_time, NULL);
+                  assert(world.runner());
+                  assert(run->test_fn);
+                  try 
+                  {
+                    return_code= world.runner()->run(run->test_fn, creators_ptr);
+                  }
+                  // Special case where check for the testing of the exception
+                  // system.
+                  catch (libtest::fatal &e)
+                  {
+                    if (fatal::is_disabled())
                     {
-                      return_code= world.runner()->run(run->test_fn, creators_ptr);
+                      fatal::increment_disabled_counter();
+                      return_code= TEST_SUCCESS;
                     }
-                    // Special case where check for the testing of the exception
-                    // system.
-                    catch (libtest::fatal &e)
+                    else
                     {
-                      if (fatal::is_disabled())
-                      {
-                        fatal::increment_disabled_counter();
-                        return_code= TEST_SUCCESS;
-                      }
-                      else
-                      {
-                        throw;
-                      }
+                      throw;
                     }
-
-                    gettimeofday(&end_time, NULL);
-                    load_time= timedif(end_time, start_time);
                   }
-                }
 
-                // @todo do something if post fails
-                (void)world.item.post(creators_ptr);
+                  gettimeofday(&end_time, NULL);
+                  load_time= timedif(end_time, start_time);
+                }
               }
               else if (return_code == TEST_SKIPPED)
               { }