ctest.cxx 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Insight Consortium. All rights reserved.
  8. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #include "ctest.h"
  14. #include "cmRegularExpression.h"
  15. #include "cmSystemTools.h"
  16. #include <stdio.h>
  17. #include <time.h>
  18. static std::string CleanString(std::string str)
  19. {
  20. std::string::size_type spos = str.find_first_not_of(" \n\t");
  21. std::string::size_type epos = str.find_last_not_of(" \n\t");
  22. if ( spos == str.npos )
  23. {
  24. return std::string();
  25. }
  26. if ( epos != str.npos )
  27. {
  28. epos ++;
  29. }
  30. return str.substr(spos, epos);
  31. }
  32. static std::string CurrentTime()
  33. {
  34. time_t currenttime = time(0);
  35. return ::CleanString(ctime(&currenttime));
  36. }
  37. bool TryExecutable(const char *dir, const char *file,
  38. std::string *fullPath, const char *subdir)
  39. {
  40. // try current directory
  41. std::string tryPath;
  42. if (dir && strcmp(dir,""))
  43. {
  44. tryPath = dir;
  45. tryPath += "/";
  46. }
  47. if (subdir && strcmp(subdir,""))
  48. {
  49. tryPath += subdir;
  50. tryPath += "/";
  51. }
  52. tryPath += file;
  53. if(cmSystemTools::FileExists(tryPath.c_str()))
  54. {
  55. *fullPath = cmSystemTools::CollapseFullPath(tryPath.c_str());
  56. return true;
  57. }
  58. tryPath += cmSystemTools::GetExecutableExtension();
  59. if(cmSystemTools::FileExists(tryPath.c_str()))
  60. {
  61. *fullPath = cmSystemTools::CollapseFullPath(tryPath.c_str());
  62. return true;
  63. }
  64. return false;
  65. }
  66. ctest::ctest()
  67. {
  68. m_UseIncludeRegExp = false;
  69. m_UseExcludeRegExp = false;
  70. m_UseExcludeRegExpFirst = false;
  71. m_Verbose = false;
  72. m_DartMode = false;
  73. int cc;
  74. for ( cc=0; cc < ctest::LAST_TEST; cc ++ )
  75. {
  76. m_Tests[cc] = 0;
  77. }
  78. }
  79. void ctest::Initialize()
  80. {
  81. m_ToplevelPath = cmSystemTools::GetCurrentWorkingDirectory();
  82. // parse the dart test file
  83. std::ifstream fin("DartConfiguration.tcl");
  84. if(!fin)
  85. {
  86. return;
  87. }
  88. char buffer[1024];
  89. while ( fin )
  90. {
  91. buffer[0] = 0;
  92. fin.getline(buffer, 1023);
  93. buffer[1023] = 0;
  94. std::string line = ::CleanString(buffer);
  95. while ( fin && (line[line.size()-1] == '\\') )
  96. {
  97. line = line.substr(0, line.size()-1);
  98. buffer[0] = 0;
  99. fin.getline(buffer, 1023);
  100. buffer[1023] = 0;
  101. line += ::CleanString(buffer);
  102. }
  103. if ( line[0] == '#' )
  104. {
  105. continue;
  106. }
  107. if ( line.size() == 0 )
  108. {
  109. continue;
  110. }
  111. std::string::size_type cpos = line.find_first_of(":");
  112. if ( cpos == line.npos )
  113. {
  114. continue;
  115. }
  116. std::string key = line.substr(0, cpos);
  117. std::string value = ::CleanString(line.substr(cpos+1, line.npos));
  118. m_DartConfiguration[key] = value;
  119. }
  120. fin.close();
  121. }
  122. bool ctest::SetTest(const char* ttype)
  123. {
  124. if ( cmSystemTools::LowerCase(ttype) == "all" )
  125. {
  126. m_Tests[ctest::ALL_TEST] = 1;
  127. }
  128. else if ( cmSystemTools::LowerCase(ttype) == "update" )
  129. {
  130. m_Tests[ctest::UPDATE_TEST] = 1;
  131. }
  132. else if ( cmSystemTools::LowerCase(ttype) == "build" )
  133. {
  134. m_Tests[ctest::BUILD_TEST] = 1;
  135. }
  136. else if ( cmSystemTools::LowerCase(ttype) == "test" )
  137. {
  138. m_Tests[ctest::TEST_TEST] = 1;
  139. }
  140. else if ( cmSystemTools::LowerCase(ttype) == "coverage" )
  141. {
  142. m_Tests[ctest::COVERAGE_TEST] = 1;
  143. }
  144. else if ( cmSystemTools::LowerCase(ttype) == "purify" )
  145. {
  146. m_Tests[ctest::PURIFY_TEST] = 1;
  147. }
  148. else
  149. {
  150. std::cerr << "Don't know about test \"" << ttype << "\" yet..." << std::endl;
  151. return false;
  152. }
  153. return true;
  154. }
  155. void ctest::Finalize()
  156. {
  157. if ( m_DartMode )
  158. {
  159. std::string testingDir = m_ToplevelPath + "/Testing/CDart";
  160. if ( cmSystemTools::FileExists(testingDir.c_str()) )
  161. {
  162. if ( !cmSystemTools::FileIsDirectory(testingDir.c_str()) )
  163. {
  164. std::cerr << "File " << testingDir << " is in the place of the testing directory"
  165. << std::endl;
  166. return;
  167. }
  168. }
  169. else
  170. {
  171. if ( !cmSystemTools::MakeDirectory(testingDir.c_str()) )
  172. {
  173. std::cerr << "Cannot create directory " << testingDir
  174. << std::endl;
  175. return;
  176. }
  177. }
  178. std::string testxml = testingDir + "/Test.xml";
  179. ofstream ofs(testxml.c_str());
  180. if( !ofs )
  181. {
  182. std::cerr << "Cannot create testing XML file" << std::endl;
  183. return;
  184. }
  185. this->GenerateDartOutput(ofs);
  186. }
  187. }
  188. std::string ctest::FindExecutable(const char *exe)
  189. {
  190. std::string fullPath = "";
  191. std::string dir;
  192. std::string file;
  193. cmSystemTools::SplitProgramPath(exe, dir, file);
  194. if(m_ConfigType != "")
  195. {
  196. if(TryExecutable(dir.c_str(), file.c_str(), &fullPath, m_ConfigType.c_str()))
  197. {
  198. return fullPath;
  199. }
  200. dir += "/";
  201. dir += m_ConfigType;
  202. dir += "/";
  203. dir += file;
  204. cmSystemTools::Error("config type specified on the command line, but test executable not found.",
  205. dir.c_str());
  206. return "";
  207. }
  208. if (TryExecutable(dir.c_str(),file.c_str(),&fullPath,"."))
  209. {
  210. return fullPath;
  211. }
  212. if (TryExecutable(dir.c_str(),file.c_str(),&fullPath,""))
  213. {
  214. return fullPath;
  215. }
  216. if (TryExecutable(dir.c_str(),file.c_str(),&fullPath,"Release"))
  217. {
  218. return fullPath;
  219. }
  220. if (TryExecutable(dir.c_str(),file.c_str(),&fullPath,"Debug"))
  221. {
  222. return fullPath;
  223. }
  224. if (TryExecutable(dir.c_str(),file.c_str(),&fullPath,"MinSizeRel"))
  225. {
  226. return fullPath;
  227. }
  228. if (TryExecutable(dir.c_str(),file.c_str(),&fullPath,"RelWithDebInfo"))
  229. {
  230. return fullPath;
  231. }
  232. // if everything else failed, check the users path
  233. if (dir != "")
  234. {
  235. std::string path = cmSystemTools::FindProgram(file.c_str());
  236. if (path != "")
  237. {
  238. return path;
  239. }
  240. }
  241. return fullPath;
  242. }
  243. void ctest::UpdateDirectory()
  244. {
  245. std::string cvsCommand = m_DartConfiguration["CVSCommand"];
  246. if ( cvsCommand.size() == 0 )
  247. {
  248. std::cerr << "Cannot find CVSCommand key in the DartConfiguration.tcl" << std::endl;
  249. return;
  250. }
  251. std::string cvsOptions = m_DartConfiguration["CVSUpdateOptions"];
  252. if ( cvsOptions.size() == 0 )
  253. {
  254. std::cerr << "Cannot find CVSUpdateOptions key in the DartConfiguration.tcl" << std::endl;
  255. return;
  256. }
  257. std::string command = cvsCommand + " update " + cvsOptions;
  258. std::string output;
  259. int retVal;
  260. bool res = cmSystemTools::RunCommand(command.c_str(), output,
  261. retVal, 0, true);
  262. if (! res || retVal )
  263. {
  264. std::cerr << "Error(s) when updating the project" << std::endl;
  265. }
  266. }
  267. void ctest::BuildDirectory()
  268. {
  269. std::string makeCommand = m_DartConfiguration["MakeCommand"];
  270. if ( makeCommand.size() == 0 )
  271. {
  272. std::cerr << "Cannot find MakeCommand key in the DartConfiguration.tcl" << std::endl;
  273. return;
  274. }
  275. std::string output;
  276. int retVal;
  277. bool res = cmSystemTools::RunCommand(makeCommand.c_str(), output,
  278. retVal, 0, true);
  279. if (! res || retVal )
  280. {
  281. std::cerr << "Error(s) when building project" << std::endl;
  282. }
  283. // To do:
  284. // Add parsing of output for errors and warnings.
  285. }
  286. void ctest::ProcessDirectory(std::vector<std::string> &passed,
  287. std::vector<std::string> &failed)
  288. {
  289. // does the DartTestfile.txt exist ?
  290. if(!cmSystemTools::FileExists("DartTestfile.txt"))
  291. {
  292. return;
  293. }
  294. // parse the file
  295. std::ifstream fin("DartTestfile.txt");
  296. if(!fin)
  297. {
  298. return;
  299. }
  300. int firstTest = 1;
  301. std::string name;
  302. std::vector<std::string> args;
  303. cmRegularExpression ireg(this->m_IncludeRegExp.c_str());
  304. cmRegularExpression ereg(this->m_ExcludeRegExp.c_str());
  305. cmRegularExpression dartStuff("([\t\n ]*<DartMeasurement.*/DartMeasurement[a-zA-Z]*>[\t ]*[\n]*)");
  306. bool parseError;
  307. while ( fin )
  308. {
  309. if(cmSystemTools::ParseFunction(fin, name, args, "DartTestfile.txt",
  310. parseError))
  311. {
  312. if (name == "SUBDIRS")
  313. {
  314. std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
  315. for(std::vector<std::string>::iterator j = args.begin();
  316. j != args.end(); ++j)
  317. {
  318. std::string nwd = cwd + "/";
  319. nwd += *j;
  320. if (cmSystemTools::FileIsDirectory(nwd.c_str()))
  321. {
  322. cmSystemTools::ChangeDirectory(nwd.c_str());
  323. this->ProcessDirectory(passed, failed);
  324. }
  325. }
  326. // return to the original directory
  327. cmSystemTools::ChangeDirectory(cwd.c_str());
  328. }
  329. if (name == "ADD_TEST")
  330. {
  331. if (this->m_UseExcludeRegExp &&
  332. this->m_UseExcludeRegExpFirst &&
  333. ereg.find(args[0].c_str()))
  334. {
  335. continue;
  336. }
  337. if (this->m_UseIncludeRegExp && !ireg.find(args[0].c_str()))
  338. {
  339. continue;
  340. }
  341. if (this->m_UseExcludeRegExp &&
  342. !this->m_UseExcludeRegExpFirst &&
  343. ereg.find(args[0].c_str()))
  344. {
  345. continue;
  346. }
  347. cmCTestTestResult cres;
  348. if (firstTest)
  349. {
  350. std::string nwd = cmSystemTools::GetCurrentWorkingDirectory();
  351. std::cerr << "Changing directory into " << nwd.c_str() << "\n";
  352. firstTest = 0;
  353. }
  354. cres.m_Name = args[0];
  355. fprintf(stderr,"Testing %-30s ",args[0].c_str());
  356. fflush(stderr);
  357. //std::cerr << "Testing " << args[0] << " ... ";
  358. // find the test executable
  359. std::string testCommand =
  360. cmSystemTools::EscapeSpaces(this->FindExecutable(args[1].c_str()).c_str());
  361. // continue if we did not find the executable
  362. if (testCommand == "")
  363. {
  364. std::cerr << "Unable to find executable: " <<
  365. args[1].c_str() << "\n";
  366. continue;
  367. }
  368. testCommand = cmSystemTools::ConvertToOutputPath(testCommand.c_str());
  369. // add the arguments
  370. std::vector<std::string>::iterator j = args.begin();
  371. ++j;
  372. ++j;
  373. for(;j != args.end(); ++j)
  374. {
  375. testCommand += " ";
  376. testCommand += cmSystemTools::EscapeSpaces(j->c_str());
  377. }
  378. /**
  379. * Run an executable command and put the stdout in output.
  380. */
  381. std::string output;
  382. int retVal;
  383. clock_t clock_start, clock_finish;
  384. double clocks_per_sec = (double)CLOCKS_PER_SEC;
  385. clock_start = clock();
  386. bool res = cmSystemTools::RunCommand(testCommand.c_str(), output,
  387. retVal, 0, false);
  388. clock_finish = clock();
  389. cres.m_ExecutionTime = (double)(clock_finish - clock_start) / clocks_per_sec;
  390. cres.m_FullCommandLine = testCommand;
  391. if (!res || retVal != 0)
  392. {
  393. fprintf(stderr,"***Failed\n");
  394. if (output != "")
  395. {
  396. if (dartStuff.find(output.c_str()))
  397. {
  398. cmSystemTools::ReplaceString(output,
  399. dartStuff.match(1).c_str(),"");
  400. }
  401. if (output != "" && m_Verbose)
  402. {
  403. std::cerr << output.c_str() << "\n";
  404. }
  405. }
  406. failed.push_back(args[0]);
  407. }
  408. else
  409. {
  410. fprintf(stderr," Passed\n");
  411. if (output != "")
  412. {
  413. if (dartStuff.find(output.c_str()))
  414. {
  415. cmSystemTools::ReplaceString(output,
  416. dartStuff.match(1).c_str(),"");
  417. }
  418. if (output != "" && m_Verbose)
  419. {
  420. std::cerr << output.c_str() << "\n";
  421. }
  422. }
  423. passed.push_back(args[0]);
  424. }
  425. cres.m_Output = output;
  426. cres.m_ReturnValue = retVal;
  427. std::string nwd = cmSystemTools::GetCurrentWorkingDirectory();
  428. if ( nwd.size() > m_ToplevelPath.size() )
  429. {
  430. nwd = "." + nwd.substr(m_ToplevelPath.size(), nwd.npos);
  431. }
  432. cres.m_Path = nwd;
  433. cres.m_CompletionStatus = "Completed";
  434. m_TestResults.push_back( cres );
  435. }
  436. }
  437. }
  438. }
  439. void ctest::GenerateDartOutput(std::ostream& os)
  440. {
  441. if ( !m_DartMode )
  442. {
  443. return;
  444. }
  445. if ( m_TestResults.size() == 0 )
  446. {
  447. return;
  448. }
  449. time_t tctime = time(0);
  450. struct tm *lctime = gmtime(&tctime);
  451. char datestring[100];
  452. sprintf(datestring, "%4d%02d%02d-%d%d",
  453. lctime->tm_year + 1900,
  454. lctime->tm_mon,
  455. lctime->tm_mday,
  456. lctime->tm_hour,
  457. lctime->tm_min);
  458. os << "Try to create dart output file" << std::endl;
  459. os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
  460. << "<Site BuildName=\"" << m_DartConfiguration["BuildName"]
  461. << "\" BuildStamp=\"" << datestring << "-Experimental\" Name=\""
  462. << m_DartConfiguration["Site"] << "\">\n"
  463. << "<Testing>\n"
  464. << " <StartDateTime>" << ::CurrentTime() << " </StartDateTime>\n"
  465. << " <TestList>\n";
  466. tm_TestResultsVector::size_type cc;
  467. for ( cc = 0; cc < m_TestResults.size(); cc ++ )
  468. {
  469. cmCTestTestResult *result = &m_TestResults[cc];
  470. os << " <Test>" << result->m_Path << "/" << result->m_Name
  471. << "</Test>" << std::endl;
  472. }
  473. os << " </TestList>\n";
  474. for ( cc = 0; cc < m_TestResults.size(); cc ++ )
  475. {
  476. cmCTestTestResult *result = &m_TestResults[cc];
  477. os << " <Test Status=\"" << (result->m_ReturnValue?"failed":"passed")
  478. << "\">\n"
  479. << " <Name>" << result->m_Name << "</Name>\n"
  480. << " <Path>" << result->m_Path << "</Path>\n"
  481. << " <FullName>" << result->m_Path << "/" << result->m_Name << "</FullName>\n"
  482. << " <FullCommandLine>" << result->m_FullCommandLine << "</FullCommandLine>\n"
  483. << " <Results>" << std::endl;
  484. if ( result->m_ReturnValue )
  485. {
  486. os << " <NamedMeasurement type=\"text/string\" name=\"Exit Code\"><Value>"
  487. << "CHILDSTATUS" << "</Value></NamedMeasurement>\n"
  488. << " <NamedMeasurement type=\"text/string\" name=\"Exit Value\"><Value>"
  489. << result->m_ReturnValue << "</Value></NamedMeasurement>" << std::endl;
  490. }
  491. os << " <NamedMeasurement type=\"numeric/double\" "
  492. << "name=\"Execution Time\"><Value>"
  493. << result->m_ExecutionTime << "</Value></NamedMeasurement>\n"
  494. << " <NamedMeasurement type=\"text/string\" "
  495. << "name=\"Completion Status\"><Value>"
  496. << result->m_CompletionStatus << "</Value></NamedMeasurement>\n"
  497. << " <Measurement>\n"
  498. << " <Value>" << result->m_Output << "</value>\n"
  499. << " </Measurement>\n"
  500. << " </Results>\n"
  501. << " </Test>" << std::endl;
  502. }
  503. os << "<EndDateTime>" << ::CurrentTime() << "</EndDateTime>\n"
  504. << "</Testing>\n"
  505. << "</Site>" << std::endl;
  506. }
  507. int ctest::ProcessTests()
  508. {
  509. int res = 0;
  510. bool notest = true;
  511. int cc;
  512. for ( cc = 0; cc < LAST_TEST; cc ++ )
  513. {
  514. if ( m_Tests[cc] )
  515. {
  516. notest = false;
  517. break;
  518. }
  519. }
  520. if ( m_Tests[UPDATE_TEST] || m_Tests[ALL_TEST] )
  521. {
  522. this->UpdateDirectory();
  523. }
  524. if ( m_Tests[BUILD_TEST] || m_Tests[ALL_TEST] )
  525. {
  526. this->BuildDirectory();
  527. }
  528. if ( m_Tests[TEST_TEST] || m_Tests[ALL_TEST] || notest )
  529. {
  530. std::vector<std::string> passed;
  531. std::vector<std::string> failed;
  532. int total;
  533. this->ProcessDirectory(passed, failed);
  534. total = int(passed.size()) + int(failed.size());
  535. if (total == 0)
  536. {
  537. std::cerr << "No tests were found!!!\n";
  538. }
  539. else
  540. {
  541. if (passed.size() && (m_UseIncludeRegExp || m_UseExcludeRegExp))
  542. {
  543. std::cerr << "\nThe following tests passed:\n";
  544. for(std::vector<std::string>::iterator j = passed.begin();
  545. j != passed.end(); ++j)
  546. {
  547. std::cerr << "\t" << *j << "\n";
  548. }
  549. }
  550. float percent = float(passed.size()) * 100.0f / total;
  551. fprintf(stderr,"\n%.0f%% tests passed, %i tests failed out of %i\n",
  552. percent, int(failed.size()), total);
  553. if (failed.size())
  554. {
  555. std::cerr << "\nThe following tests FAILED:\n";
  556. for(std::vector<std::string>::iterator j = failed.begin();
  557. j != failed.end(); ++j)
  558. {
  559. std::cerr << "\t" << *j << "\n";
  560. }
  561. }
  562. }
  563. res += int(failed.size());
  564. }
  565. if ( m_Tests[COVERAGE_TEST] || m_Tests[ALL_TEST] )
  566. {
  567. std::cerr << "Coverage test is not yet implemented" << std::endl;
  568. }
  569. if ( m_Tests[PURIFY_TEST] || m_Tests[ALL_TEST] )
  570. {
  571. std::cerr << "Purify test is not yet implemented" << std::endl;
  572. }
  573. return res;
  574. }
  575. // this is a test driver program for cmake.
  576. int main (int argc, char *argv[])
  577. {
  578. ctest inst;
  579. // look at the args
  580. std::vector<std::string> args;
  581. for(int i =0; i < argc; ++i)
  582. {
  583. args.push_back(argv[i]);
  584. }
  585. #ifdef _WIN32
  586. std::string comspec = "cmw9xcom.exe";
  587. cmSystemTools::SetWindows9xComspecSubstitute(comspec.c_str());
  588. #endif
  589. for(unsigned int i=1; i < args.size(); ++i)
  590. {
  591. std::string arg = args[i];
  592. if(arg.find("-D",0) == 0 && i < args.size() - 1)
  593. {
  594. inst.m_ConfigType = args[i+1];
  595. }
  596. if( arg.find("-V",0) == 0 || arg.find("--verbose",0) == 0 )
  597. {
  598. inst.m_Verbose = true;
  599. }
  600. if( ( arg.find("-T",0) == 0 || arg.find("--dart-mode",0) == 0 ) && (i < args.size() -1) )
  601. {
  602. inst.m_DartMode = true;
  603. inst.SetTest(args[i+1].c_str());
  604. }
  605. if(arg.find("-R",0) == 0 && i < args.size() - 1)
  606. {
  607. inst.m_UseIncludeRegExp = true;
  608. inst.m_IncludeRegExp = args[i+1];
  609. }
  610. if(arg.find("-E",0) == 0 && i < args.size() - 1)
  611. {
  612. inst.m_UseExcludeRegExp = true;
  613. inst.m_ExcludeRegExp = args[i+1];
  614. inst.m_UseExcludeRegExpFirst = inst.m_UseIncludeRegExp ? false : true;
  615. }
  616. if(arg.find("-h") == 0 ||
  617. arg.find("-help") == 0 ||
  618. arg.find("-H") == 0 ||
  619. arg.find("--help") == 0 ||
  620. arg.find("/H") == 0 ||
  621. arg.find("/HELP") == 0 ||
  622. arg.find("/?") == 0)
  623. {
  624. std::cerr << "Usage: " << argv[0] << " <options>" << std::endl
  625. << "\t -D type Specify config type" << std::endl
  626. << "\t -E test Specify regular expression for tests to exclude"
  627. << std::endl
  628. << "\t -R test Specify regular expression for tests to include"
  629. << std::endl
  630. << "\t -V Verbose testing" << std::endl
  631. << "\t -H Help page" << std::endl;
  632. return 1;
  633. }
  634. }
  635. // call process directory
  636. inst.Initialize();
  637. int res = inst.ProcessTests();
  638. inst.Finalize();
  639. return res;
  640. }