From a834d2e9ff08343d3df5a466f41d0c3e7072a984 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 1 Jul 2015 19:40:41 +0000 Subject: Major test refactor to support test suites. Refactor all common code from testbbackupd and testbackupstore to allow other test suites to contain multiple tests and execute selected tests more easily. Report all test results within a suite in a standard, easy to read summary. --- infrastructure/buildenv-testmain-template.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'infrastructure/buildenv-testmain-template.cpp') diff --git a/infrastructure/buildenv-testmain-template.cpp b/infrastructure/buildenv-testmain-template.cpp index 09be9f70..6855e990 100644 --- a/infrastructure/buildenv-testmain-template.cpp +++ b/infrastructure/buildenv-testmain-template.cpp @@ -61,11 +61,6 @@ int test(int argc, const char *argv[]); #define MODE_TEXT "debug" #endif -int failures = 0; -int first_fail_line; -std::string first_fail_file; -std::list run_only_named_tests; - #ifdef WIN32 #define QUIET_PROCESS "-Q" #else @@ -386,7 +381,7 @@ int main(int argc, char * const * argv) #ifdef BOX_MEMORY_LEAK_TESTING if(memleakfinder_numleaks() != 0) { - failures++; + num_failures++; printf("FAILURE: Memory leaks detected in test code\n"); printf("==== MEMORY LEAKS =================================\n"); memleakfinder_reportleaks(); @@ -405,13 +400,13 @@ int main(int argc, char * const * argv) if(filesleftopen) { - failures++; + num_failures++; printf("IMPLICIT TEST FAILED: Something left files open\n"); } - if(failures > 0) + if(num_failures > 0) { printf("FAILED: %d tests failed (first at " - "%s:%d)\n", failures, + "%s:%d)\n", num_failures, first_fail_file.c_str(), first_fail_line); } -- cgit v1.2.3