From 4f8f01cee6b1cd29186d9c8dbfe9e98fa7595433 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 31 Aug 2006 22:00:04 +0000 Subject: * infrastructure/buildenv-testmain-template.cpp Record the file and line of first test failure, and print them at the end of the test, useful for debugging when the first failure has scrolled off screen (refs #3) --- infrastructure/buildenv-testmain-template.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'infrastructure/buildenv-testmain-template.cpp') diff --git a/infrastructure/buildenv-testmain-template.cpp b/infrastructure/buildenv-testmain-template.cpp index f95f01e6..c64c1fa5 100644 --- a/infrastructure/buildenv-testmain-template.cpp +++ b/infrastructure/buildenv-testmain-template.cpp @@ -41,6 +41,8 @@ int test(int argc, const char *argv[]); #endif int failures = 0; +int first_fail_line; +std::string first_fail_file; int filedes_open_at_beginning = -1; @@ -128,7 +130,10 @@ int main(int argc, const char *argv[]) } if(failures > 0) { - printf("FAILED: %d tests failed\n", failures); + printf("FAILED: %d tests failed (first at " + "%s:%d)\n", failures, + first_fail_file.c_str(), + first_fail_line); } else { -- cgit v1.2.3