Sample test application.
*/
-#include "config.h"
+#include <config.h>
#include <unistd.h>
#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)
{
if (sasl_client_init(NULL) != SASL_OK)
{
fprintf(stderr, "Failed to initialize sasl library!\n");
- return 1;
+ return EXIT_FAILURE;
}
#endif
}
if (argc > 1)
+ {
collection_to_run= argv[1];
+ }
+ else if (getenv("TEST_COLLECTION"))
+ {
+ collection_to_run= getenv("TEST_COLLECTION");
+ }
+
+ if (collection_to_run)
+ printf("Only testing %s\n", collection_to_run);
if (argc == 3)
+ {
wildcard= argv[2];
+ }
for (next= collection; next->name; next++)
{
stats.success++;
break;
case TEST_FAILURE:
+#if 0
+ push_failed_test(next->name, run->name);
+#endif
stats.failed++;
failed= true;
break;
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
{
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;
}