From be03e10b26eaa53aca68517f4086560e74c9a7cf Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 18 Dec 2007 00:19:20 +0000 Subject: Better way to pass arguments to test daemons, with --test-daemon-args. --- infrastructure/buildenv-testmain-template.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'infrastructure') diff --git a/infrastructure/buildenv-testmain-template.cpp b/infrastructure/buildenv-testmain-template.cpp index b392606b..45ad0933 100644 --- a/infrastructure/buildenv-testmain-template.cpp +++ b/infrastructure/buildenv-testmain-template.cpp @@ -164,12 +164,13 @@ int main(int argc, char * const * argv) { { "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 @@ int main(int argc, char * const * argv) } break; + case 'd': + { + if (test_args.length() > 0) + { + test_args += " "; + } + test_args += optarg; + } + break; + case 's': { bbstored_args += " "; @@ -194,16 +205,12 @@ int main(int argc, char * const * argv) case 't': { Console::SetTag(optarg); - test_args += " -t '"; - test_args += optarg; - test_args += "'"; } break; case 'T': { Console::SetShowTime(true); - test_args += " -T"; } break; @@ -211,7 +218,12 @@ int main(int argc, char * const * argv) { Console::SetShowTime(true); Console::SetShowTimeMicros(true); - test_args += " -U"; + } + break; + + case 'V': + { + Logging::SetGlobalLevel(Log::EVERYTHING); } break; -- cgit v1.2.3