[Box Backup-commit] COMMIT r2010 - in box/trunk: infrastructure lib/common test/basicserver
boxbackup-dev@fluffy.co.uk
boxbackup-dev@fluffy.co.uk
Sun, 16 Dec 2007 23:52:08 +0000 (UTC)
Author: chris
Date: 2007-12-16 23:52:05 +0000 (Sun, 16 Dec 2007)
New Revision: 2010
Modified:
box/trunk/infrastructure/buildenv-testmain-template.cpp
box/trunk/lib/common/Test.h
box/trunk/test/basicserver/testbasicserver.cpp
Log:
Pass test options to test daemons.
Modified: box/trunk/infrastructure/buildenv-testmain-template.cpp
===================================================================
--- box/trunk/infrastructure/buildenv-testmain-template.cpp 2007-12-16 16:48:28 UTC (rev 2009)
+++ box/trunk/infrastructure/buildenv-testmain-template.cpp 2007-12-16 23:52:05 UTC (rev 2010)
@@ -57,7 +57,7 @@
int failures = 0;
int first_fail_line;
std::string first_fail_file;
-std::string bbackupd_args, bbstored_args, bbackupquery_args;
+std::string bbackupd_args, bbstored_args, bbackupquery_args, test_args;
int filedes_open_at_beginning = -1;
@@ -194,12 +194,16 @@
case 't':
{
Console::SetTag(optarg);
+ test_args += " -t '";
+ test_args += optarg;
+ test_args += "'";
}
break;
case 'T':
{
Console::SetShowTime(true);
+ test_args += " -T";
}
break;
@@ -207,13 +211,14 @@
{
Console::SetShowTime(true);
Console::SetShowTimeMicros(true);
+ test_args += " -U";
}
break;
case '?':
{
- fprintf(stderr, "Unknown option: %s\n",
- optarg);
+ fprintf(stderr, "Unknown option: '%c'\n",
+ optopt);
exit(2);
}
Modified: box/trunk/lib/common/Test.h
===================================================================
--- box/trunk/lib/common/Test.h 2007-12-16 16:48:28 UTC (rev 2009)
+++ box/trunk/lib/common/Test.h 2007-12-16 23:52:05 UTC (rev 2010)
@@ -43,7 +43,7 @@
extern int failures;
extern int first_fail_line;
extern std::string first_fail_file;
-extern std::string bbackupd_args, bbstored_args, bbackupquery_args;
+extern std::string bbackupd_args, bbstored_args, bbackupquery_args, test_args;
#define TEST_FAIL_WITH_MESSAGE(msg) \
{ \
Modified: box/trunk/test/basicserver/testbasicserver.cpp
===================================================================
--- box/trunk/test/basicserver/testbasicserver.cpp 2007-12-16 16:48:28 UTC (rev 2009)
+++ box/trunk/test/basicserver/testbasicserver.cpp 2007-12-16 23:52:05 UTC (rev 2010)
@@ -436,8 +436,10 @@
// Launch a basic server
{
- int pid = LaunchServer("./test srv1 testfiles/srv1.conf",
- "testfiles/srv1.pid");
+ std::string cmd = "./test";
+ cmd += test_args;
+ cmd += " srv1 testfiles/srv1.conf";
+ int pid = LaunchServer(cmd, "testfiles/srv1.pid");
TEST_THAT(pid != -1 && pid != 0);
if(pid > 0)
@@ -480,8 +482,10 @@
// Launch a test forking server
{
- int pid = LaunchServer("./test srv2 testfiles/srv2.conf",
- "testfiles/srv2.pid");
+ std::string cmd = "./test";
+ cmd += test_args;
+ cmd += " srv2 testfiles/srv2.conf";
+ int pid = LaunchServer(cmd, "testfiles/srv2.pid");
TEST_THAT(pid != -1 && pid != 0);
@@ -548,8 +552,10 @@
// Launch a test SSL server
{
- int pid = LaunchServer("./test srv3 testfiles/srv3.conf",
- "testfiles/srv3.pid");
+ std::string cmd = "./test";
+ cmd += test_args;
+ cmd += " srv3 testfiles/srv3.conf";
+ int pid = LaunchServer(cmd, "testfiles/srv3.pid");
TEST_THAT(pid != -1 && pid != 0);
@@ -627,8 +633,10 @@
//protocolserver:
// Launch a test protocol handling server
{
- int pid = LaunchServer("./test srv4 testfiles/srv4.conf",
- "testfiles/srv4.pid");
+ std::string cmd = "./test";
+ cmd += test_args;
+ cmd += " srv4 testfiles/srv4.conf";
+ int pid = LaunchServer(cmd, "testfiles/srv4.pid");
TEST_THAT(pid != -1 && pid != 0);