diff options
author | Brad King <brad.king@kitware.com> | 2009-01-12 15:37:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-01-12 15:37:55 (GMT) |
commit | 447f5b303eab1b076f49ed52af90e554160dddc6 (patch) | |
tree | 6e27fdd66c1b7d39440d94681457c2765a957a99 | |
parent | 4b97fab34d07afe05b057dbb6b2c64f4f0d24f40 (diff) | |
download | CMake-447f5b303eab1b076f49ed52af90e554160dddc6.zip CMake-447f5b303eab1b076f49ed52af90e554160dddc6.tar.gz CMake-447f5b303eab1b076f49ed52af90e554160dddc6.tar.bz2 |
ENH: Divide CTest file submission list by part
This splits the list of files for CTest to submit into those belonging
to each part. The set is recombined just before submission. Later this
will allow piecewise submissions.
-rw-r--r-- | Source/CTest/cmCTestBuildHandler.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestConfigureHandler.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 7 | ||||
-rw-r--r-- | Source/CTest/cmCTestGenericHandler.cxx | 7 | ||||
-rw-r--r-- | Source/CTest/cmCTestGenericHandler.h | 5 | ||||
-rw-r--r-- | Source/CTest/cmCTestSubmitHandler.cxx | 37 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 1 | ||||
-rw-r--r-- | Source/CTest/cmCTestUpdateHandler.cxx | 2 | ||||
-rw-r--r-- | Source/cmCTest.cxx | 13 | ||||
-rw-r--r-- | Source/cmCTest.h | 10 |
10 files changed, 50 insertions, 36 deletions
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 989f938..ca7061b 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -467,7 +467,7 @@ int cmCTestBuildHandler::ProcessHandler() // Generate XML output cmGeneratedFileStream xofs; - if( !this->StartResultingXML("Build", xofs)) + if(!this->StartResultingXML(cmCTest::PartBuild, "Build", xofs)) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot create build XML file" << std::endl); diff --git a/Source/CTest/cmCTestConfigureHandler.cxx b/Source/CTest/cmCTestConfigureHandler.cxx index 42b7c71..6004508 100644 --- a/Source/CTest/cmCTestConfigureHandler.cxx +++ b/Source/CTest/cmCTestConfigureHandler.cxx @@ -67,7 +67,7 @@ int cmCTestConfigureHandler::ProcessHandler() if ( !this->CTest->GetShowOnly() ) { cmGeneratedFileStream os; - if ( !this->StartResultingXML("Configure", os) ) + if(!this->StartResultingXML(cmCTest::PartConfigure, "Configure", os)) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open configure file" << std::endl); diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 0b11018..a248bc6 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -162,7 +162,8 @@ bool cmCTestCoverageHandler::StartCoverageLogFile( sprintf(covLogFilename, "CoverageLog-%d", logFileCount); cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Open file: " << covLogFilename << std::endl); - if (!this->StartResultingXML(covLogFilename, covLogFile) ) + if(!this->StartResultingXML(cmCTest::PartCoverage, + covLogFilename, covLogFile)) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open log file: " << covLogFilename << std::endl); @@ -381,7 +382,7 @@ int cmCTestCoverageHandler::ProcessHandler() cmGeneratedFileStream covSumFile; cmGeneratedFileStream covLogFile; - if (!this->StartResultingXML("Coverage", covSumFile)) + if(!this->StartResultingXML(cmCTest::PartCoverage, "Coverage", covSumFile)) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open coverage summary file." << std::endl); @@ -1434,7 +1435,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary( std::ostream& tmpLog = *cont->OFS; // copen the Coverage.xml file in the Testing directory cmGeneratedFileStream covSumFile; - if (!this->StartResultingXML("Coverage", covSumFile)) + if(!this->StartResultingXML(cmCTest::PartCoverage, "Coverage", covSumFile)) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open coverage summary file." << std::endl); diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx index 5060774..4e7dd56 100644 --- a/Source/CTest/cmCTestGenericHandler.cxx +++ b/Source/CTest/cmCTestGenericHandler.cxx @@ -104,8 +104,9 @@ const char* cmCTestGenericHandler::GetOption(const char* op) } //---------------------------------------------------------------------- -bool cmCTestGenericHandler::StartResultingXML(const char* name, - cmGeneratedFileStream& xofs) +bool cmCTestGenericHandler::StartResultingXML(cmCTest::Part part, + const char* name, + cmGeneratedFileStream& xofs) { if ( !name ) { @@ -139,7 +140,7 @@ bool cmCTestGenericHandler::StartResultingXML(const char* name, << std::endl); return false; } - this->CTest->AddSubmitFile(ostr.str().c_str()); + this->CTest->AddSubmitFile(part, ostr.str().c_str()); return true; } diff --git a/Source/CTest/cmCTestGenericHandler.h b/Source/CTest/cmCTestGenericHandler.h index 69bfb7f..da404c4 100644 --- a/Source/CTest/cmCTestGenericHandler.h +++ b/Source/CTest/cmCTestGenericHandler.h @@ -20,8 +20,8 @@ #include "cmObject.h" +#include "cmCTest.h" -class cmCTest; class cmMakefile; class cmCTestCommand; class cmGeneratedFileStream; @@ -91,7 +91,8 @@ public: void SetAppendXML(bool b) { this->AppendXML = b; } protected: - bool StartResultingXML(const char* name, cmGeneratedFileStream& xofs); + bool StartResultingXML(cmCTest::Part part, + const char* name, cmGeneratedFileStream& xofs); bool StartLogFile(const char* name, cmGeneratedFileStream& xofs); bool AppendXML; diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index dbc9124..3e811d5 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -852,15 +852,14 @@ int cmCTestSubmitHandler::ProcessHandler() cmGeneratedFileStream ofs; this->StartLogFile("Submit", ofs); - cmCTest::SetOfStrings files; std::string prefix = this->GetSubmitResultsPrefix(); // TODO: // Check if test is enabled - this->CTest->AddIfExists(files, "Update.xml"); - this->CTest->AddIfExists(files, "Configure.xml"); - this->CTest->AddIfExists(files, "Build.xml"); - this->CTest->AddIfExists(files, "Test.xml"); - if ( this->CTest->AddIfExists(files, "Coverage.xml") ) + this->CTest->AddIfExists(cmCTest::PartUpdate, "Update.xml"); + this->CTest->AddIfExists(cmCTest::PartConfigure, "Configure.xml"); + this->CTest->AddIfExists(cmCTest::PartBuild, "Build.xml"); + this->CTest->AddIfExists(cmCTest::PartTest, "Test.xml"); + if(this->CTest->AddIfExists(cmCTest::PartCoverage, "Coverage.xml")) { cmCTest::VectorOfStrings gfiles; std::string gpath @@ -877,7 +876,7 @@ int cmCTestSubmitHandler::ProcessHandler() gfiles[cc] = gfiles[cc].substr(glen); cmCTestLog(this->CTest, DEBUG, "Glob file: " << gfiles[cc].c_str() << std::endl); - files.insert(gfiles[cc]); + this->CTest->AddSubmitFile(cmCTest::PartCoverage, gfiles[cc].c_str()); } } else @@ -885,22 +884,28 @@ int cmCTestSubmitHandler::ProcessHandler() cmCTestLog(this->CTest, ERROR_MESSAGE, "Problem globbing" << std::endl); } } - this->CTest->AddIfExists(files, "DynamicAnalysis.xml"); - this->CTest->AddIfExists(files, "Purify.xml"); - this->CTest->AddIfExists(files, "Notes.xml"); - - cmCTest::SetOfStrings::iterator it; - for ( it = this->CTest->GetSubmitFiles()->begin(); - it != this->CTest->GetSubmitFiles()->end(); - ++ it ) + this->CTest->AddIfExists(cmCTest::PartMemCheck, "DynamicAnalysis.xml"); + this->CTest->AddIfExists(cmCTest::PartMemCheck, "Purify.xml"); + this->CTest->AddIfExists(cmCTest::PartNotes, "Notes.xml"); + + // Query parts for files to submit. + cmCTest::SetOfStrings files; + for(cmCTest::Part p = cmCTest::PartStart; + p != cmCTest::PartCount; p = cmCTest::Part(p+1)) { - files.insert(files.end(), *it); + std::vector<std::string> const& pfiles = this->CTest->GetSubmitFiles(p); + for(std::vector<std::string>::const_iterator pi = pfiles.begin(); + pi != pfiles.end(); ++pi) + { + files.insert(*pi); + } } if ( ofs ) { ofs << "Upload files:" << std::endl; int cnt = 0; + cmCTest::SetOfStrings::iterator it; for ( it = files.begin(); it != files.end(); ++ it ) { ofs << cnt << "\t" << it->c_str() << std::endl; diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 52b23d5..cc2a2b0 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -592,6 +592,7 @@ int cmCTestTestHandler::ProcessHandler() { cmGeneratedFileStream xmlfile; if( !this->StartResultingXML( + (this->MemCheck ? cmCTest::PartMemCheck : cmCTest::PartTest), (this->MemCheck ? "DynamicAnalysis" : "Test"), xmlfile) ) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot create " diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index 67ae202..e1eeeb1 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -578,7 +578,7 @@ int cmCTestUpdateHandler::ProcessHandler() // Now update repository and remember what files were updated // cmGeneratedFileStream os; - if ( !this->StartResultingXML("Update", os) ) + if(!this->StartResultingXML(cmCTest::PartUpdate, "Update", os)) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open log file" << std::endl); diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 7d3a7cb..5e2406b 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -269,6 +269,7 @@ cmCTest::cmCTest() this->Parts[PartMemCheck].SetName("MemCheck"); this->Parts[PartSubmit].SetName("Submit"); this->Parts[PartNotes].SetName("Notes"); + this->Parts[PartExtraFiles].SetName("ExtraFiles"); // Fill the part name-to-id map. for(Part p = PartStart; p != PartCount; p = Part(p+1)) @@ -734,11 +735,11 @@ bool cmCTest::OpenOutputFile(const std::string& path, } //---------------------------------------------------------------------- -bool cmCTest::AddIfExists(SetOfStrings& files, const char* file) +bool cmCTest::AddIfExists(Part part, const char* file) { if ( this->CTestFileExists(file) ) { - files.insert(file); + this->AddSubmitFile(part, file); } else { @@ -746,7 +747,7 @@ bool cmCTest::AddIfExists(SetOfStrings& files, const char* file) name += ".gz"; if ( this->CTestFileExists(name.c_str()) ) { - files.insert(name.c_str()); + this->AddSubmitFile(part, file); } else { @@ -1448,7 +1449,7 @@ bool cmCTest::SubmitExtraFiles(const std::vector<cmStdString> &files) << std::endl;); return false; } - this->AddSubmitFile(it->c_str()); + this->AddSubmitFile(PartExtraFiles, it->c_str()); } return true; } @@ -2436,9 +2437,9 @@ void cmCTest::SetSpecificTrack(const char* track) } //---------------------------------------------------------------------- -void cmCTest::AddSubmitFile(const char* name) +void cmCTest::AddSubmitFile(Part part, const char* name) { - this->SubmitFiles.insert(name); + this->Parts[part].SubmitFiles.push_back(name); } //---------------------------------------------------------------------- diff --git a/Source/cmCTest.h b/Source/cmCTest.h index f3cdaab..d822fec 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -62,6 +62,7 @@ public: PartMemCheck, PartSubmit, PartNotes, + PartExtraFiles, PartCount // Update names in constructor when adding a part }; @@ -75,6 +76,8 @@ public: void Enable() { this->Enabled = true; } operator bool() const { return this->Enabled; } + + std::vector<std::string> SubmitFiles; private: bool Enabled; std::string Name; @@ -147,7 +150,7 @@ public: * Check if CTest file exists */ bool CTestFileExists(const std::string& filename); - bool AddIfExists(SetOfStrings& files, const char* file); + bool AddIfExists(Part part, const char* file); /** * Set the cmake test @@ -352,8 +355,9 @@ public: int GetDartVersion() { return this->DartVersion; } //! Add file to be submitted - void AddSubmitFile(const char* name); - SetOfStrings* GetSubmitFiles() { return &this->SubmitFiles; } + void AddSubmitFile(Part part, const char* name); + std::vector<std::string> const& GetSubmitFiles(Part part) + { return this->Parts[part].SubmitFiles; } //! Read the custom configuration files and apply them to the current ctest int ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf); |