summaryrefslogtreecommitdiff
path: root/Source/CTest/cmCTestBuildHandler.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-02-04 14:34:12 -0500
committerBrad King <brad.king@kitware.com>2009-02-04 14:34:12 -0500
commit5f65e04ea2f348bd4584a14afa32a32725f77ce4 (patch)
treee3b8244d4dfa1f8c1e2a7e3821544d6f597a3c22 /Source/CTest/cmCTestBuildHandler.cxx
parentc6d499aba5c8848a559a76ee67c84abb992b138b (diff)
downloadcmake-5f65e04ea2f348bd4584a14afa32a32725f77ce4.tar.gz
ENH: Refactor Build.xml generation
This divides cmCTestBuildHandler::GenerateDartBuildOutput into three methods to generate the header, content, and footer components of Build.xml files. It will allow the content generation to be replaced later.
Diffstat (limited to 'Source/CTest/cmCTestBuildHandler.cxx')
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx23
1 files changed, 16 insertions, 7 deletions
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index ab19b7b2e4..5b5c68ec83 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -473,16 +473,14 @@ int cmCTestBuildHandler::ProcessHandler()
<< std::endl);
return -1;
}
- this->GenerateDartBuildOutput(
- xofs, this->ErrorsAndWarnings, elapsed_build_time);
+ this->GenerateXMLHeader(xofs);
+ this->GenerateXMLLogScraped(xofs);
+ this->GenerateXMLFooter(xofs, elapsed_build_time);
return retVal;
}
-//----------------------------------------------------------------------
-void cmCTestBuildHandler::GenerateDartBuildOutput(
- std::ostream& os,
- std::vector<cmCTestBuildErrorWarning> ew,
- double elapsed_build_time)
+//----------------------------------------------------------------------------
+void cmCTestBuildHandler::GenerateXMLHeader(std::ostream& os)
{
this->CTest->StartXML(os, this->AppendXML);
os << "<Build>\n"
@@ -494,7 +492,12 @@ void cmCTestBuildHandler::GenerateDartBuildOutput(
<< this->CTest->MakeXMLSafe(
this->CTest->GetCTestConfiguration("MakeCommand"))
<< "</BuildCommand>" << std::endl;
+}
+//----------------------------------------------------------------------------
+void cmCTestBuildHandler::GenerateXMLLogScraped(std::ostream& os)
+{
+ std::vector<cmCTestBuildErrorWarning>& ew = this->ErrorsAndWarnings;
std::vector<cmCTestBuildErrorWarning>::iterator it;
// only report the first 50 warnings and first 50 errors
@@ -591,6 +594,12 @@ void cmCTestBuildHandler::GenerateDartBuildOutput(
<< std::endl;
}
}
+}
+
+//----------------------------------------------------------------------------
+void cmCTestBuildHandler::GenerateXMLFooter(std::ostream& os,
+ double elapsed_build_time)
+{
os << "\t<Log Encoding=\"base64\" Compression=\"/bin/gzip\">\n\t</Log>\n"
<< "\t<EndDateTime>" << this->EndBuild << "</EndDateTime>\n"
<< "\t<EndBuildTime>" << static_cast<unsigned int>(this->EndBuildTime)