Lines Matching refs:cmdLine
86 void registerOptions (de::cmdline::Parser& parser)
88 using de::cmdline::Option;
89 using de::cmdline::NamedValue;
109 << Option<CmdLineArgs> (DE_NULL, "cmdline", "Additional command line arguments for the test binary.", "");
141 bool parseCommandLine (CommandLine& cmdLine, int argc, const char* const* argv)
143 de::cmdline::Parser parser;
144 de::cmdline::CommandLine opts;
176 cmdLine.runMode = RUNMODE_START_SERVER;
177 cmdLine.serverBinOrAddress = opts.getOption<opt::StartServer>();
181 cmdLine.runMode = RUNMODE_CONNECT;
182 cmdLine.serverBinOrAddress = opts.getOption<opt::Host>();
187 cmdLine.inFile = opts.getOption<opt::ContinueFile>();
189 if (cmdLine.inFile.empty())
196 cmdLine.port = opts.getOption<opt::Port>();
197 cmdLine.caseListDir = opts.getOption<opt::CaseListDir>();
198 cmdLine.testset = opts.getOption<opt::TestSet>();
199 cmdLine.exclude = opts.getOption<opt::ExcludeSet>();
200 cmdLine.outFile = opts.getOption<opt::TestLogFile>();
201 cmdLine.infoFile = opts.getOption<opt::InfoLogFile>();
202 cmdLine.summary = opts.getOption<opt::Summary>();
203 cmdLine.targetCfg.binaryName = opts.getOption<opt::BinaryName>();
204 cmdLine.targetCfg.workingDir = opts.getOption<opt::WorkingDir>();
205 cmdLine.targetCfg.cmdLineArgs = opts.getOption<opt::CmdLineArgs>();
458 xe::CommLink* createCommLink (const CommandLine& cmdLine)
460 if (cmdLine.runMode == RUNMODE_START_SERVER)
465 link->start(cmdLine.serverBinOrAddress.c_str(), DE_NULL, cmdLine.port);
474 else if (cmdLine.runMode == RUNMODE_CONNECT)
480 address.setHost(cmdLine.serverBinOrAddress.c_str());
481 address.setPort(cmdLine.port);
494 throw xe::Error("Failed to connect to ExecServer at: " + cmdLine.serverBinOrAddress + ":" + de::toString(cmdLine.port) + ", " + error.what());
577 void runExecutor (const CommandLine& cmdLine)
582 readCaseLists(root, cmdLine.caseListDir.c_str());
588 for (vector<string>::const_iterator filterIter = cmdLine.testset.begin(); filterIter != cmdLine.testset.end(); ++filterIter)
595 for (vector<string>::const_iterator filterIter = cmdLine.exclude.begin(); filterIter != cmdLine.exclude.end(); ++filterIter)
603 if (!cmdLine.inFile.empty())
604 readLogFile(&batchResult, cmdLine.inFile.c_str());
607 std::auto_ptr<xe::CommLink> commLink(createCommLink(cmdLine));
609 xe::BatchExecutor executor(cmdLine.targetCfg, commLink.get(), &root, testSet, &batchResult, &infoLog);
621 if (!cmdLine.outFile.empty())
623 xe::writeBatchResultToFile(batchResult, cmdLine.outFile.c_str());
624 printf("Test log written to %s\n", cmdLine
627 if (!cmdLine.infoFile.empty())
629 writeInfoLog(infoLog, cmdLine.infoFile.c_str());
630 printf("Info log written to %s\n", cmdLine.infoFile.c_str());
633 if (cmdLine.summary)
639 if (!cmdLine.outFile.empty())
641 xe::writeBatchResultToFile(batchResult, cmdLine.outFile.c_str());
642 printf("Test log written to %s\n", cmdLine.outFile.c_str());
645 if (!cmdLine.infoFile.empty())
647 writeInfoLog(infoLog, cmdLine.infoFile.c_str());
648 printf("Info log written to %s\n", cmdLine.infoFile.c_str());
651 if (cmdLine.summary)
666 CommandLine cmdLine;
668 if (!parseCommandLine(cmdLine, argc, argv))
673 runExecutor(cmdLine);