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

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Tue, 18 Dec 2007 00:19:20 +0000 (UTC)


Author: chris
Date: 2007-12-18 00:19:20 +0000 (Tue, 18 Dec 2007)
New Revision: 2013

Modified:
   box/trunk/infrastructure/buildenv-testmain-template.cpp
Log:
Better way to pass arguments to test daemons, with --test-daemon-args.


Modified: box/trunk/infrastructure/buildenv-testmain-template.cpp
===================================================================
--- box/trunk/infrastructure/buildenv-testmain-template.cpp	2007-12-18 00:17:54 UTC (rev 2012)
+++ box/trunk/infrastructure/buildenv-testmain-template.cpp	2007-12-18 00:19:20 UTC (rev 2013)
@@ -164,12 +164,13 @@
 	{
 		{ "bbackupd-args",	required_argument, NULL, 'c' },
 		{ "bbstored-args",	required_argument, NULL, 's' },
+		{ "test-daemon-args",	required_argument, NULL, 'd' },
 		{ NULL,			0,                 NULL,  0  }
 	};
 	
 	int ch;
 	
-	while ((ch = getopt_long(argc, argv, "c:s:t:TU", longopts, NULL))
+	while ((ch = getopt_long(argc, argv, "c:d:s:t:TUV", longopts, NULL))
 		!= -1)
 	{
 		switch(ch)
@@ -184,6 +185,16 @@
 			}
 			break;
 
+			case 'd':
+			{
+				if (test_args.length() > 0)
+				{
+					test_args += " ";
+				}
+				test_args += optarg;
+			}
+			break;
+
 			case 's':
 			{
 				bbstored_args += " ";
@@ -194,16 +205,12 @@
 			case 't':
 			{
 				Console::SetTag(optarg);
-				test_args += " -t '";
-				test_args += optarg;
-				test_args += "'";
 			}
 			break;
 
 			case 'T':
 			{
 				Console::SetShowTime(true);
-				test_args += " -T";
 			}
 			break;
 
@@ -211,10 +218,15 @@
 			{
 				Console::SetShowTime(true);
 				Console::SetShowTimeMicros(true);
-				test_args += " -U";
 			}
 			break;
 
+			case 'V':
+			{
+				Logging::SetGlobalLevel(Log::EVERYTHING);
+			}
+			break;
+
 			case '?':
 			{
 				fprintf(stderr, "Unknown option: '%c'\n",