Merge in trunk.
[m6w6/libmemcached] / libtest / test.c
index 009c4be5c7e9289c550b36b3c4cdb0a9bc726250..afb2b96522ce4c1f582e4fa6771c5c2bb2735c31 100644 (file)
@@ -10,7 +10,7 @@
   Sample test application.
 */
 
-#include "config.h"
+#include <config.h>
 
 #include <unistd.h>
 
@@ -24,9 +24,8 @@
 #include <time.h>
 #include <stdint.h>
 
-#include <libmemcached/memcached.h>
-
 #include <libtest/test.h>
+#include <libtest/failed.h>
 
 static void world_stats_print(world_stats_st *stats)
 {
@@ -156,7 +155,7 @@ int main(int argc, char *argv[])
   if (sasl_client_init(NULL) != SASL_OK)
   {
      fprintf(stderr, "Failed to initialize sasl library!\n");
-     return 1;
+     return EXIT_FAILURE;
   }
 #endif
 
@@ -298,6 +297,9 @@ skip_pre:
         stats.success++;
         break;
       case TEST_FAILURE:
+#if 0
+        push_failed_test(next->name, run->name);
+#endif
         stats.failed++;
         failed= true;
         break;
@@ -343,6 +345,9 @@ cleanup:
   if (stats.collection_failed || stats.collection_skipped)
   {
     fprintf(stderr, "Some test failures and/or skipped test occurred.\n\n");
+#if 0
+    print_failed_test();
+#endif
   }
   else
   {
@@ -357,15 +362,11 @@ cleanup:
     if (error != TEST_SUCCESS)
     {
       fprintf(stderr, "Failure during shutdown.\n");
-      stats.failed++; // We do this to make our exit code return 1
+      stats.failed++; // We do this to make our exit code return EXIT_FAILURE
     }
   }
 
   world_stats_print(&stats);
 
-#ifdef LIBMEMCACHED_WITH_SASL_SUPPORT
-  sasl_done();
-#endif
-
   return stats.failed == 0 ? 0 : 1;
 }