[Box Backup-dev] COMMIT r871 - box/chris/merge/infrastructure

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Thu, 31 Aug 2006 23:00:04 +0100


Author: chris
Date: 2006-08-31 23:00:04 +0100 (Thu, 31 Aug 2006)
New Revision: 871

Modified:
   box/chris/merge/infrastructure/buildenv-testmain-template.cpp
Log:
* 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)


Modified: box/chris/merge/infrastructure/buildenv-testmain-template.cpp
===================================================================
--- box/chris/merge/infrastructure/buildenv-testmain-template.cpp	2006-08-31 21:58:47 UTC (rev 870)
+++ box/chris/merge/infrastructure/buildenv-testmain-template.cpp	2006-08-31 22:00:04 UTC (rev 871)
@@ -41,6 +41,8 @@
 #endif
 
 int failures = 0;
+int first_fail_line;
+std::string first_fail_file;
 
 int filedes_open_at_beginning = -1;
 
@@ -128,7 +130,10 @@
 			}
 			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
 			{