X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Ftest.c;h=d54dc92b9836347a533685a942ba74bb7324b5b3;hb=c3723b53b87471782076765f0fff656d07de74e0;hp=009c4be5c7e9289c550b36b3c4cdb0a9bc726250;hpb=349ca737f30ff0b6c3c71034f0930660663fa360;p=awesomized%2Flibmemcached diff --git a/libtest/test.c b/libtest/test.c index 009c4be5..d54dc92b 100644 --- a/libtest/test.c +++ b/libtest/test.c @@ -10,7 +10,7 @@ Sample test application. */ -#include "config.h" +#include #include @@ -24,9 +24,8 @@ #include #include -#include - #include +#include 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 @@ -179,10 +178,21 @@ int main(int argc, char *argv[]) } 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++) { @@ -298,6 +308,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 +356,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 +373,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; }