summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-01-12 14:11:29 (GMT)
committerBrad King <brad.king@kitware.com>2009-01-12 14:11:29 (GMT)
commitcccac773cea0d724474a441a2e205cdb2d7193de (patch)
tree7c9e24087bf1fa8de084a6b7d9fd729829eb51ce
parentae2c4143d288624b6703085602ecee2289b3ee27 (diff)
downloadCMake-cccac773cea0d724474a441a2e205cdb2d7193de.zip
CMake-cccac773cea0d724474a441a2e205cdb2d7193de.tar.gz
CMake-cccac773cea0d724474a441a2e205cdb2d7193de.tar.bz2
ENH: Teach ctest_* to create appending XML files
This adds an APPEND option to the ctest_* commands which tells them to put the Append="true" attribute in the Site element of their XML file.
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx2
-rw-r--r--Source/CTest/cmCTestConfigureHandler.cxx2
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx6
-rw-r--r--Source/CTest/cmCTestGenericHandler.cxx1
-rw-r--r--Source/CTest/cmCTestGenericHandler.h3
-rw-r--r--Source/CTest/cmCTestHandlerCommand.cxx11
-rw-r--r--Source/CTest/cmCTestHandlerCommand.h2
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx2
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx2
-rw-r--r--Source/cmCTest.cxx3
-rw-r--r--Source/cmCTest.h2
11 files changed, 27 insertions, 9 deletions
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index 4c612c0..989f938 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -484,7 +484,7 @@ void cmCTestBuildHandler::GenerateDartBuildOutput(
std::vector<cmCTestBuildErrorWarning> ew,
double elapsed_build_time)
{
- this->CTest->StartXML(os);
+ this->CTest->StartXML(os, this->AppendXML);
os << "<Build>\n"
<< "\t<StartDateTime>" << this->StartBuild << "</StartDateTime>\n"
<< "\t<StartBuildTime>" <<
diff --git a/Source/CTest/cmCTestConfigureHandler.cxx b/Source/CTest/cmCTestConfigureHandler.cxx
index c744d77..42b7c71 100644
--- a/Source/CTest/cmCTestConfigureHandler.cxx
+++ b/Source/CTest/cmCTestConfigureHandler.cxx
@@ -92,7 +92,7 @@ int cmCTestConfigureHandler::ProcessHandler()
if ( os )
{
- this->CTest->StartXML(os);
+ this->CTest->StartXML(os, this->AppendXML);
os << "<Configure>\n"
<< "\t<StartDateTime>" << start_time << "</StartDateTime>"
<< std::endl
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 86534d7..0b11018 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -169,7 +169,7 @@ bool cmCTestCoverageHandler::StartCoverageLogFile(
return false;
}
std::string local_start_time = this->CTest->CurrentTime();
- this->CTest->StartXML(covLogFile);
+ this->CTest->StartXML(covLogFile, this->AppendXML);
covLogFile << "<CoverageLog>" << std::endl
<< "\t<StartDateTime>" << local_start_time << "</StartDateTime>"
<< "\t<StartTime>"
@@ -388,7 +388,7 @@ int cmCTestCoverageHandler::ProcessHandler()
return -1;
}
- this->CTest->StartXML(covSumFile);
+ this->CTest->StartXML(covSumFile, this->AppendXML);
// Produce output xml files
covSumFile << "<Coverage>" << std::endl
@@ -1440,7 +1440,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
"Cannot open coverage summary file." << std::endl);
return 0;
}
- this->CTest->StartXML(covSumFile);
+ this->CTest->StartXML(covSumFile, this->AppendXML);
double elapsed_time_start = cmSystemTools::GetTime();
std::string coverage_start_time = this->CTest->CurrentTime();
covSumFile << "<Coverage>" << std::endl
diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx
index 6c06f0b..5060774 100644
--- a/Source/CTest/cmCTestGenericHandler.cxx
+++ b/Source/CTest/cmCTestGenericHandler.cxx
@@ -26,6 +26,7 @@ cmCTestGenericHandler::cmCTestGenericHandler()
this->HandlerVerbose = false;
this->CTest = 0;
this->SubmitIndex = 0;
+ this->AppendXML = false;
}
//----------------------------------------------------------------------
diff --git a/Source/CTest/cmCTestGenericHandler.h b/Source/CTest/cmCTestGenericHandler.h
index 2b84ded..69bfb7f 100644
--- a/Source/CTest/cmCTestGenericHandler.h
+++ b/Source/CTest/cmCTestGenericHandler.h
@@ -88,10 +88,13 @@ public:
void SetSubmitIndex(int idx) { this->SubmitIndex = idx; }
int GetSubmitIndex() { return this->SubmitIndex; }
+ void SetAppendXML(bool b) { this->AppendXML = b; }
+
protected:
bool StartResultingXML(const char* name, cmGeneratedFileStream& xofs);
bool StartLogFile(const char* name, cmGeneratedFileStream& xofs);
+ bool AppendXML;
bool HandlerVerbose;
cmCTest *CTest;
t_StringToString Options;
diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx
index e4ae832..1175879 100644
--- a/Source/CTest/cmCTestHandlerCommand.cxx
+++ b/Source/CTest/cmCTestHandlerCommand.cxx
@@ -33,6 +33,7 @@ cmCTestHandlerCommand::cmCTestHandlerCommand()
this->Arguments[ct_BUILD] = "BUILD";
this->Arguments[ct_SUBMIT_INDEX] = "SUBMIT_INDEX";
this->Last = ct_LAST;
+ this->AppendXML = false;
}
bool cmCTestHandlerCommand
@@ -73,6 +74,8 @@ bool cmCTestHandlerCommand
return false;
}
+ handler->SetAppendXML(this->AppendXML);
+
handler->PopulateCustomVectors(this->Makefile);
if ( this->Values[ct_BUILD] )
{
@@ -143,6 +146,14 @@ bool cmCTestHandlerCommand
//----------------------------------------------------------------------------
bool cmCTestHandlerCommand::CheckArgumentKeyword(std::string const& arg)
{
+ // Look for non-value arguments common to all commands.
+ if(arg == "APPEND")
+ {
+ this->ArgumentDoing = ArgumentDoingNone;
+ this->AppendXML = true;
+ return true;
+ }
+
// Check for a keyword in our argument/value table.
for(unsigned int k=0; k < this->Arguments.size(); ++k)
{
diff --git a/Source/CTest/cmCTestHandlerCommand.h b/Source/CTest/cmCTestHandlerCommand.h
index 8c2e651..dc123ba 100644
--- a/Source/CTest/cmCTestHandlerCommand.h
+++ b/Source/CTest/cmCTestHandlerCommand.h
@@ -66,6 +66,8 @@ protected:
int ArgumentDoing;
unsigned int ArgumentIndex;
+ bool AppendXML;
+
std::string ReturnVariable;
std::vector<const char*> Arguments;
std::vector<const char*> Values;
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index 71832b5..31af3ce 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -287,7 +287,7 @@ void cmCTestMemCheckHandler::GenerateDartOutput(std::ostream& os)
return;
}
- this->CTest->StartXML(os);
+ this->CTest->StartXML(os, this->AppendXML);
os << "<DynamicAnalysis Checker=\"";
switch ( this->MemoryTesterStyle )
{
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 68c5855..52b23d5 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -1442,7 +1442,7 @@ void cmCTestTestHandler::GenerateDartOutput(std::ostream& os)
return;
}
- this->CTest->StartXML(os);
+ this->CTest->StartXML(os, this->AppendXML);
os << "<Testing>\n"
<< "\t<StartDateTime>" << this->StartTest << "</StartDateTime>\n"
<< "\t<StartTestTime>" << this->StartTestTime << "</StartTestTime>\n"
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 6a5fc39..9567033 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1269,7 +1269,7 @@ int cmCTest::RunTest(std::vector<const char*> argv,
}
//----------------------------------------------------------------------
-void cmCTest::StartXML(std::ostream& ostr)
+void cmCTest::StartXML(std::ostream& ostr, bool append)
{
if(this->CurrentTag.empty())
{
@@ -1289,6 +1289,7 @@ void cmCTest::StartXML(std::ostream& ostr)
<< this->GetTestModelString() << "\"\n\tName=\""
<< this->GetCTestConfiguration("Site") << "\"\n\tGenerator=\"ctest"
<< cmVersion::GetCMakeVersion() << "\"\n"
+ << (append? "\tAppend=\"true\"\n":"")
<< "\tOSName=\"" << info.GetOSName() << "\"\n"
<< "\tHostname=\"" << info.GetHostname() << "\"\n"
<< "\tOSRelease=\"" << info.GetOSRelease() << "\"\n"
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index 9916a00..edce0c4 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -199,7 +199,7 @@ public:
int* retVal = 0, const char* dir = 0, double timeout = 0.0);
//! Start CTest XML output file
- void StartXML(std::ostream& ostr);
+ void StartXML(std::ostream& ostr, bool append);
//! End CTest XML output file
void EndXML(std::ostream& ostr);