diff options
author | Chris Wilson <chris+github@qwirx.com> | 2015-07-01 19:40:41 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2015-07-01 19:40:41 +0000 |
commit | a834d2e9ff08343d3df5a466f41d0c3e7072a984 (patch) | |
tree | d88f16f40a76fd2d75818d6993df58851b240bc0 /infrastructure/buildenv-testmain-template.cpp | |
parent | fb9042ed02544a1a783b2ffa6b5ea7e85a16a703 (diff) |
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.
Diffstat (limited to 'infrastructure/buildenv-testmain-template.cpp')
-rw-r--r-- | infrastructure/buildenv-testmain-template.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
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<std::string> 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); } |