cmCTestBuildHandler.cxx 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html 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 "cmCTestBuildHandler.h"
  14. #include "cmCTest.h"
  15. #include "cmake.h"
  16. #include "cmMakefile.h"
  17. #include "cmLocalGenerator.h"
  18. #include "cmGlobalGenerator.h"
  19. #include "cmGeneratedFileStream.h"
  20. //#include <cmsys/RegularExpression.hxx>
  21. #include <cmsys/Process.h>
  22. // used for sleep
  23. #ifdef _WIN32
  24. #include "windows.h"
  25. #endif
  26. #include <stdlib.h>
  27. #include <time.h>
  28. #include <math.h>
  29. #include <float.h>
  30. static const char* cmCTestErrorMatches[] = {
  31. "^[Bb]us [Ee]rror",
  32. "^[Ss]egmentation [Vv]iolation",
  33. "^[Ss]egmentation [Ff]ault",
  34. "([^ :]+):([0-9]+): ([^ \\t])",
  35. "([^:]+): error[ \\t]*[0-9]+[ \\t]*:",
  36. "^Error ([0-9]+):",
  37. "^Fatal",
  38. "^Error: ",
  39. "^Error ",
  40. "[0-9] ERROR: ",
  41. "^\"[^\"]+\", line [0-9]+: [^Ww]",
  42. "^cc[^C]*CC: ERROR File = ([^,]+), Line = ([0-9]+)",
  43. "^ld([^:])*:([ \\t])*ERROR([^:])*:",
  44. "^ild:([ \\t])*\\(undefined symbol\\)",
  45. "([^ :]+) : (error|fatal error|catastrophic error)",
  46. "([^:]+): (Error:|error|undefined reference|multiply defined)",
  47. "([^:]+)\\(([^\\)]+)\\) : (error|fatal error|catastrophic error)",
  48. "^fatal error C[0-9]+:",
  49. ": syntax error ",
  50. "^collect2: ld returned 1 exit status",
  51. "Unsatisfied symbols:",
  52. "^Unresolved:",
  53. "Undefined symbols:",
  54. "^Undefined[ \\t]+first referenced",
  55. "^CMake Error:",
  56. ":[ \\t]cannot find",
  57. ":[ \\t]can't find",
  58. ": \\*\\*\\* No rule to make target \\`.*\\'. Stop",
  59. ": Invalid loader fixup for symbol",
  60. ": internal link edit command failed",
  61. ": Unrecognized option \\`.*\\'",
  62. "\", line [0-9]+\\.[0-9]+: [0-9]+-[0-9]+ \\([^W]\\)",
  63. "ld: 0706-006 Cannot find or open library file: -l ",
  64. "ild: \\(argument error\\) can't find library argument ::",
  65. "^could not be found and will not be loaded.",
  66. "s:616 string too big",
  67. "make: Fatal error: ",
  68. "ld: 0711-993 Error occurred while writing to the output file:",
  69. "ld: fatal: ",
  70. "make: \\*\\*\\*.*Error",
  71. "\\*\\*\\* Error code",
  72. "^Internal error:",
  73. 0
  74. };
  75. static const char* cmCTestErrorExceptions[] = {
  76. "instantiated from ",
  77. "candidates are:",
  78. ": warning",
  79. "makefile:",
  80. "Makefile:",
  81. ":[ \\t]+Where:",
  82. "([^ :]+):([0-9]+): Warning",
  83. 0
  84. };
  85. static const char* cmCTestWarningMatches[] = {
  86. "([^ :]+):([0-9]+): warning:",
  87. "^cc[^C]*CC: WARNING File = ([^,]+), Line = ([0-9]+)",
  88. "^ld([^:])*:([ \\t])*WARNING([^:])*:",
  89. "([^:]+): warning ([0-9]+):",
  90. "^\"[^\"]+\", line [0-9]+: [Ww]arning",
  91. "([^:]+): warning[ \\t]*[0-9]+[ \\t]*:",
  92. "^Warning ([0-9]+):",
  93. "^Warning ",
  94. "WARNING: ",
  95. "([^ :]+) : warning",
  96. "([^:]+): warning",
  97. "\", line [0-9]+\\.[0-9]+: [0-9]+-[0-9]+ \\(W\\)",
  98. "^cxx: Warning:",
  99. ".*file: .* has no symbols",
  100. "([^ :]+):([0-9]+): Warning",
  101. "\\([0-9]*\\): remark #[0-9]*",
  102. "\".*\", line [0-9]+: remark\\([0-9]*\\):",
  103. "cc-[0-9]* CC: REMARK File = .*, Line = [0-9]*",
  104. 0
  105. };
  106. static const char* cmCTestWarningExceptions[] = {
  107. "/usr/openwin/include/X11/Xlib\\.h:[0-9]+: warning: ANSI C\\+\\+ forbids declaration",
  108. "/usr/openwin/include/X11/Xutil\\.h:[0-9]+: warning: ANSI C\\+\\+ forbids declaration",
  109. "/usr/openwin/include/X11/XResource\\.h:[0-9]+: warning: ANSI C\\+\\+ forbids declaration",
  110. "WARNING 84 :",
  111. "WARNING 47 :",
  112. "makefile:",
  113. "Makefile:",
  114. "warning: Clock skew detected. Your build may be incomplete.",
  115. "/usr/openwin/include/GL/[^:]+:",
  116. "bind_at_load",
  117. "XrmQGetResource",
  118. "IceFlush",
  119. "warning LNK4089: all references to [^ \\t]+ discarded by .OPT:REF",
  120. "ld32: WARNING 85: definition of dataKey in",
  121. "cc: warning 422: Unknown option \"\\+b",
  122. "_with_warning_C",
  123. 0
  124. };
  125. struct cmCTestBuildCompileErrorWarningRex
  126. {
  127. const char* m_RegularExpressionString;
  128. int m_FileIndex;
  129. int m_LineIndex;
  130. };
  131. static cmCTestBuildCompileErrorWarningRex
  132. cmCTestWarningErrorFileLine[] = {
  133. { "^Warning W[0-9]+ ([a-zA-Z.\\:/0-9_+ ~-]+) ([0-9]+):", 1, 2 },
  134. { "^([a-zA-Z./0-9_+ ~-]+):([0-9]+):", 1, 2 },
  135. { "^([a-zA-Z.\\:/0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 },
  136. { "^([a-zA-Z./0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 },
  137. { "\"([a-zA-Z./0-9_+ ~-]+)\", line ([0-9]+)", 1, 2 },
  138. { "File = ([a-zA-Z./0-9_+ ~-]+), Line = ([0-9]+)", 1, 2 },
  139. { 0, 0, 0 }
  140. };
  141. //----------------------------------------------------------------------
  142. cmCTestBuildHandler::cmCTestBuildHandler()
  143. {
  144. int cc;
  145. for ( cc = 0; cmCTestWarningErrorFileLine[cc].m_RegularExpressionString; ++ cc )
  146. {
  147. cmCTestBuildHandler::cmCTestCompileErrorWarningRex r;
  148. if ( r.m_RegularExpression.compile(
  149. cmCTestWarningErrorFileLine[cc].m_RegularExpressionString) )
  150. {
  151. r.m_FileIndex = cmCTestWarningErrorFileLine[cc].m_FileIndex;
  152. r.m_LineIndex = cmCTestWarningErrorFileLine[cc].m_LineIndex;
  153. m_ErrorWarningFileLineRegex.push_back(r);
  154. }
  155. else
  156. {
  157. std::cout << "Problem Compiling regular expression: "
  158. << cmCTestWarningErrorFileLine[cc].m_RegularExpressionString << std::endl;
  159. }
  160. }
  161. }
  162. //----------------------------------------------------------------------
  163. void cmCTestBuildHandler::PopulateCustomVectors(cmMakefile *mf)
  164. {
  165. cmCTest::PopulateCustomVector(mf, "CTEST_CUSTOM_ERROR_MATCH",
  166. m_CustomErrorMatches);
  167. cmCTest::PopulateCustomVector(mf, "CTEST_CUSTOM_ERROR_EXCEPTION",
  168. m_CustomErrorExceptions);
  169. cmCTest::PopulateCustomVector(mf, "CTEST_CUSTOM_WARNING_MATCH",
  170. m_CustomWarningMatches);
  171. cmCTest::PopulateCustomVector(mf, "CTEST_CUSTOM_WARNING_EXCEPTION",
  172. m_CustomWarningExceptions);
  173. }
  174. //----------------------------------------------------------------------
  175. //clearly it would be nice if this were broken up into a few smaller
  176. //functions and commented...
  177. int cmCTestBuildHandler::ProcessHandler()
  178. {
  179. std::cout << "Build project" << std::endl;
  180. const std::string &makeCommand = m_CTest->GetCTestConfiguration("MakeCommand");
  181. if ( makeCommand.size() == 0 )
  182. {
  183. std::cerr << "Cannot find MakeCommand key in the DartConfiguration.tcl" << std::endl;
  184. return -1;
  185. }
  186. const std::string &buildDirectory = m_CTest->GetCTestConfiguration("BuildDirectory");
  187. if ( buildDirectory.size() == 0 )
  188. {
  189. std::cerr << "Cannot find BuildDirectory key in the DartConfiguration.tcl" << std::endl;
  190. return -1;
  191. }
  192. cmGeneratedFileStream ofs;
  193. double elapsed_time_start = cmSystemTools::GetTime();
  194. if ( !m_CTest->OpenOutputFile("Temporary", "LastBuild.log", ofs) )
  195. {
  196. std::cerr << "Cannot create LastBuild.log file" << std::endl;
  197. }
  198. m_StartBuild = m_CTest->CurrentTime();
  199. std::string output;
  200. int retVal = 0;
  201. int res = cmsysProcess_State_Exited;
  202. if ( !m_CTest->GetShowOnly() )
  203. {
  204. res = m_CTest->RunMakeCommand(makeCommand.c_str(), &output,
  205. &retVal, buildDirectory.c_str(),
  206. m_Verbose, 0, ofs);
  207. }
  208. else
  209. {
  210. std::cout << "Build with command: " << makeCommand << std::endl;
  211. }
  212. m_EndBuild = m_CTest->CurrentTime();
  213. double elapsed_build_time = cmSystemTools::GetTime() - elapsed_time_start;
  214. if (res != cmsysProcess_State_Exited || retVal )
  215. {
  216. std::cerr << "Error(s) when building project" << std::endl;
  217. }
  218. std::vector<cmStdString>::size_type cc;
  219. if ( m_CTest->GetCTestConfiguration("SourceDirectory").size() > 20 ||
  220. m_CTest->GetCTestConfiguration("BuildDirectory").size() > 20 )
  221. {
  222. std::string srcdir = m_CTest->GetCTestConfiguration("SourceDirectory") + "/";
  223. std::string bindir = m_CTest->GetCTestConfiguration("BuildDirectory") + "/";
  224. std::string srcdirrep;
  225. std::string bindirrep;
  226. for ( cc = srcdir.size()-2; cc > 0; cc -- )
  227. {
  228. if ( srcdir[cc] == '/' )
  229. {
  230. srcdirrep = srcdir.c_str() + cc;
  231. srcdirrep = "/..." + srcdirrep;
  232. srcdir = srcdir.substr(0, cc+1);
  233. break;
  234. }
  235. }
  236. for ( cc = bindir.size()-2; cc > 0; cc -- )
  237. {
  238. if ( bindir[cc] == '/' )
  239. {
  240. bindirrep = bindir.c_str() + cc;
  241. bindirrep = "/..." + bindirrep;
  242. bindir = bindir.substr(0, cc+1);
  243. break;
  244. }
  245. }
  246. cmSystemTools::ReplaceString(output, srcdir.c_str(), "/.../"); //srcdirrep.c_str());
  247. cmSystemTools::ReplaceString(output, bindir.c_str(), "/.../"); //bindirrep.c_str());
  248. }
  249. // Parsing of output for errors and warnings.
  250. std::vector<cmStdString> lines;
  251. cmSystemTools::Split(output.c_str(), lines);
  252. // Lines are marked:
  253. // 0 - nothing
  254. // 1 - error
  255. // > 1 - warning
  256. std::vector<int> markedLines(lines.size(), 0);
  257. // Errors
  258. for ( cc = 0; cmCTestErrorMatches[cc]; cc ++ )
  259. {
  260. m_CustomErrorMatches.push_back(cmCTestErrorMatches[cc]);
  261. }
  262. for ( cc = 0; cmCTestErrorExceptions[cc]; cc ++ )
  263. {
  264. m_CustomErrorExceptions.push_back(cmCTestErrorExceptions[cc]);
  265. }
  266. for ( cc = 0; cmCTestWarningMatches[cc]; cc ++ )
  267. {
  268. m_CustomWarningMatches.push_back(cmCTestWarningMatches[cc]);
  269. }
  270. for ( cc = 0; cmCTestWarningExceptions[cc]; cc ++ )
  271. {
  272. m_CustomWarningExceptions.push_back(cmCTestWarningExceptions[cc]);
  273. }
  274. for ( cc = 0; cc < m_CustomErrorMatches.size(); cc ++ )
  275. {
  276. cmsys::RegularExpression re(m_CustomErrorMatches[cc].c_str());
  277. std::vector<cmStdString>::size_type kk;
  278. //cout << "error Line: " << m_CustomErrorMatches[cc] << endl;
  279. for ( kk = 0; kk < lines.size(); kk ++ )
  280. {
  281. //cout << " Line: " << lines[kk] << endl;
  282. if ( re.find(lines[kk]) )
  283. {
  284. //cout << "******************************" << endl;
  285. markedLines[kk] = 1;
  286. }
  287. }
  288. }
  289. // Warnings
  290. for ( cc = 0; cc < m_CustomWarningMatches.size(); cc ++ )
  291. {
  292. cmsys::RegularExpression re(m_CustomWarningMatches[cc].c_str());
  293. std::vector<cmStdString>::size_type kk;
  294. //cout << "warning Line: " << m_CustomWarningMatches[cc] << endl;
  295. for ( kk = 0; kk < lines.size(); kk ++ )
  296. {
  297. //cout << " Line: " << lines[kk] << endl;
  298. if ( re.find(lines[kk]) )
  299. {
  300. //cout << "******************************" << endl;
  301. markedLines[kk] += 2;
  302. }
  303. }
  304. }
  305. // the two follwing blocks of code appear wrong to me - Ken
  306. // I belive that the middle if tests should be %2 type tests
  307. // need to close the loop with Andy
  308. // Errors exceptions
  309. for ( cc = 0; cc < m_CustomErrorExceptions.size(); cc ++ )
  310. {
  311. cmsys::RegularExpression re(m_CustomErrorExceptions[cc].c_str());
  312. std::vector<int>::size_type kk;
  313. for ( kk =0; kk < markedLines.size(); kk ++ )
  314. {
  315. if ( markedLines[kk] == 1 )
  316. {
  317. if ( re.find(lines[kk]) )
  318. {
  319. markedLines[kk] = 0;
  320. }
  321. }
  322. }
  323. }
  324. // Warning exceptions
  325. for ( cc = 0; cc < m_CustomWarningExceptions.size(); cc ++ )
  326. {
  327. cmsys::RegularExpression re(m_CustomWarningExceptions[cc].c_str());
  328. std::vector<int>::size_type kk;
  329. for ( kk =0; kk < markedLines.size(); kk ++ )
  330. {
  331. if ( markedLines[kk] > 1 )
  332. {
  333. if ( re.find(lines[kk]) )
  334. {
  335. markedLines[kk] = 0;
  336. }
  337. }
  338. }
  339. }
  340. std::vector<cmCTestBuildErrorWarning> errorsWarnings;
  341. int errors = 0;
  342. int warnings = 0;
  343. std::vector<int>::size_type kk;
  344. cmCTestBuildErrorWarning errorwarning;
  345. for ( kk =0; kk < markedLines.size(); kk ++ )
  346. {
  347. errorwarning.m_LineNumber = -1;
  348. bool found = false;
  349. if ( markedLines[kk] == 1 )
  350. {
  351. //std::cout << "Error: " << lines[kk] << std::endl;
  352. errorwarning.m_Error = true;
  353. found = true;
  354. }
  355. else if ( markedLines[kk] > 1 )
  356. {
  357. //std::cout << "Warning: " << lines[kk] << std::endl;
  358. errorwarning.m_Error = false;
  359. found = true;
  360. }
  361. if ( found )
  362. {
  363. errorwarning.m_LogLine = static_cast<int>(kk+1);
  364. errorwarning.m_Text = lines[kk];
  365. errorwarning.m_PreContext = "";
  366. errorwarning.m_PostContext = "";
  367. std::vector<int>::size_type jj;
  368. std::vector<int>::size_type ll = 0;
  369. if ( kk > 6 )
  370. {
  371. ll = kk - 6;
  372. }
  373. for ( jj = kk-1;
  374. jj > 0 && jj > ll && markedLines[jj] != markedLines[kk];
  375. jj -- );
  376. while ( markedLines[jj] == markedLines[kk] && jj < kk )
  377. {
  378. jj ++;
  379. }
  380. for (; jj < kk; jj ++ )
  381. {
  382. errorwarning.m_PreContext += lines[jj] + "\n";
  383. }
  384. for ( jj = kk+1;
  385. jj < lines.size() && jj < kk + 7 && markedLines[jj] != markedLines[kk];
  386. jj ++ )
  387. {
  388. errorwarning.m_PostContext += lines[jj] + "\n";
  389. }
  390. errorsWarnings.push_back(errorwarning);
  391. if ( errorwarning.m_Error )
  392. {
  393. errors ++;
  394. }
  395. else
  396. {
  397. warnings ++;
  398. }
  399. }
  400. }
  401. std::cout << " " << errors << " Compiler errors" << std::endl;
  402. std::cout << " " << warnings << " Compiler warnings" << std::endl;
  403. cmGeneratedFileStream xofs;
  404. if( !m_CTest->OpenOutputFile(m_CTest->GetCurrentTag(), "Build.xml", xofs, true) )
  405. {
  406. std::cerr << "Cannot create build XML file" << std::endl;
  407. return -1;
  408. }
  409. this->GenerateDartBuildOutput(xofs, errorsWarnings, elapsed_build_time);
  410. return 0;
  411. }
  412. void cmCTestBuildHandler::GenerateDartBuildOutput(
  413. std::ostream& os,
  414. std::vector<cmCTestBuildErrorWarning> ew,
  415. double elapsed_build_time)
  416. {
  417. m_CTest->StartXML(os);
  418. os << "<Build>\n"
  419. << "\t<StartDateTime>" << m_StartBuild << "</StartDateTime>\n"
  420. << "<BuildCommand>"
  421. << m_CTest->MakeXMLSafe(m_CTest->GetCTestConfiguration("MakeCommand"))
  422. << "</BuildCommand>" << std::endl;
  423. std::vector<cmCTestBuildErrorWarning>::iterator it;
  424. // only report the first 50 warnings and first 50 errors
  425. unsigned short numErrorsAllowed = 50;
  426. unsigned short numWarningsAllowed = 50;
  427. std::string srcdir = m_CTest->GetCTestConfiguration("SourceDirectory");
  428. // make sure the source dir is in the correct case on windows
  429. // via a call to collapse full path.
  430. srcdir = cmSystemTools::CollapseFullPath(srcdir.c_str());
  431. srcdir += "/";
  432. for ( it = ew.begin();
  433. it != ew.end() && (numErrorsAllowed || numWarningsAllowed); it++ )
  434. {
  435. cmCTestBuildErrorWarning *cm = &(*it);
  436. if (cm->m_Error && numErrorsAllowed ||
  437. !cm->m_Error && numWarningsAllowed)
  438. {
  439. if (cm->m_Error)
  440. {
  441. numErrorsAllowed--;
  442. }
  443. else
  444. {
  445. numWarningsAllowed--;
  446. }
  447. os << "\t<" << (cm->m_Error ? "Error" : "Warning") << ">\n"
  448. << "\t\t<BuildLogLine>" << cm->m_LogLine << "</BuildLogLine>\n"
  449. << "\t\t<Text>" << m_CTest->MakeXMLSafe(cm->m_Text)
  450. << "\n</Text>" << std::endl;
  451. std::vector<cmCTestCompileErrorWarningRex>::iterator rit;
  452. for ( rit = m_ErrorWarningFileLineRegex.begin();
  453. rit != m_ErrorWarningFileLineRegex.end(); ++ rit )
  454. {
  455. cmsys::RegularExpression* re = &rit->m_RegularExpression;
  456. if ( re->find(cm->m_Text.c_str() ) )
  457. {
  458. cm->m_SourceFile = re->match(rit->m_FileIndex);
  459. // At this point we need to make m_SourceFile relative to
  460. // the source root of the project, so cvs links will work
  461. cmSystemTools::ConvertToUnixSlashes(cm->m_SourceFile);
  462. if(cm->m_SourceFile.find("/.../") != cm->m_SourceFile.npos)
  463. {
  464. cmSystemTools::ReplaceString(cm->m_SourceFile, "/.../", "");
  465. std::string::size_type p = cm->m_SourceFile.find("/");
  466. if(p != cm->m_SourceFile.npos)
  467. {
  468. cm->m_SourceFile = cm->m_SourceFile.substr(p+1, cm->m_SourceFile.size()-p);
  469. }
  470. }
  471. else
  472. {
  473. // make sure it is a full path with the correct case
  474. cm->m_SourceFile = cmSystemTools::CollapseFullPath(cm->m_SourceFile.c_str());
  475. cmSystemTools::ReplaceString(cm->m_SourceFile, srcdir.c_str(), "");
  476. }
  477. cm->m_LineNumber = atoi(re->match(rit->m_LineIndex).c_str());
  478. break;
  479. }
  480. }
  481. if ( cm->m_SourceFile.size() > 0 )
  482. {
  483. os << "\t\t<SourceFile>" << cm->m_SourceFile << "</SourceFile>"
  484. << std::endl;
  485. }
  486. if ( cm->m_SourceFileTail.size() > 0 )
  487. {
  488. os << "\t\t<SourceFileTail>" << cm->m_SourceFileTail
  489. << "</SourceFileTail>" << std::endl;
  490. }
  491. if ( cm->m_LineNumber >= 0 )
  492. {
  493. os << "\t\t<SourceLineNumber>" << cm->m_LineNumber
  494. << "</SourceLineNumber>" << std::endl;
  495. }
  496. os << "\t\t<PreContext>" << m_CTest->MakeXMLSafe(cm->m_PreContext)
  497. << "</PreContext>\n"
  498. << "\t\t<PostContext>" << m_CTest->MakeXMLSafe(cm->m_PostContext);
  499. // is this the last warning or error, if so notify
  500. if (cm->m_Error && !numErrorsAllowed ||
  501. !cm->m_Error && !numWarningsAllowed)
  502. {
  503. os << "\nThe maximum number of reported warnings or errors has been reached!!!\n";
  504. }
  505. os << "</PostContext>\n"
  506. << "\t\t<RepeatCount>0</RepeatCount>\n"
  507. << "</" << (cm->m_Error ? "Error" : "Warning") << ">\n\n"
  508. << std::endl;
  509. }
  510. }
  511. os << "\t<Log Encoding=\"base64\" Compression=\"/bin/gzip\">\n\t</Log>\n"
  512. << "\t<EndDateTime>" << m_EndBuild << "</EndDateTime>\n"
  513. << "<ElapsedMinutes>" << static_cast<int>(elapsed_build_time/6)/10.0
  514. << "</ElapsedMinutes>"
  515. << "</Build>" << std::endl;
  516. m_CTest->EndXML(os);
  517. }