[Box Backup-commit] COMMIT r2166 - box/trunk/infrastructure

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Wed, 28 May 2008 10:42:37 +0100 (BST)


Author: chris
Date: 2008-05-28 10:42:37 +0100 (Wed, 28 May 2008)
New Revision: 2166

Modified:
   box/trunk/infrastructure/buildenv-testmain-template.cpp
Log:
Set program name in tests to module name (e.g. test/bbackupd).

Add option to show PID in logs (-P) in tests.


Modified: box/trunk/infrastructure/buildenv-testmain-template.cpp
===================================================================
--- box/trunk/infrastructure/buildenv-testmain-template.cpp	2008-05-28 09:41:32 UTC (rev 2165)
+++ box/trunk/infrastructure/buildenv-testmain-template.cpp	2008-05-28 09:42:37 UTC (rev 2166)
@@ -164,6 +164,8 @@
 	// Start memory leak testing
 	MEMLEAKFINDER_START
 
+	Logging::SetProgramName(BOX_MODULE);
+
 #ifdef HAVE_GETOPT_H
 	#ifdef NDEBUG
 	int logLevel = Log::NOTICE; // need an int to do math with
@@ -181,7 +183,7 @@
 	
 	int ch;
 	
-	while ((ch = getopt_long(argc, argv, "c:d:qs:t:vTUV", longopts, NULL))
+	while ((ch = getopt_long(argc, argv, "c:d:qs:t:vPTUV", longopts, NULL))
 		!= -1)
 	{
 		switch(ch)
@@ -213,6 +215,14 @@
 			}
 			break;
 
+			#ifndef WIN32
+			case 'P':
+			{
+				Console::SetShowPID(true);
+			}
+			break;
+			#endif
+
 			case 'q':
 			{
 				if(logLevel == Log::NOTHING)