diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2009-01-09 17:05:23 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2009-01-09 17:05:23 (GMT) |
commit | ed387ffe6b72986856ca1f14c9ac11c4e12c5d6b (patch) | |
tree | 10bc89c82e4b6c9c23834e261fea52f9c771b12d /Source | |
parent | 86b103f2713113327d1ee9325e1c635ec41e4009 (diff) | |
download | CMake-ed387ffe6b72986856ca1f14c9ac11c4e12c5d6b.zip CMake-ed387ffe6b72986856ca1f14c9ac11c4e12c5d6b.tar.gz CMake-ed387ffe6b72986856ca1f14c9ac11c4e12c5d6b.tar.bz2 |
ENH: add subproject tag property for ctest
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestScriptHandler.h | 2 | ||||
-rw-r--r-- | Source/cmCTest.cxx | 48 | ||||
-rw-r--r-- | Source/cmCTest.h | 3 |
3 files changed, 44 insertions, 9 deletions
diff --git a/Source/CTest/cmCTestScriptHandler.h b/Source/CTest/cmCTestScriptHandler.h index d410c4e..ba59a33 100644 --- a/Source/CTest/cmCTestScriptHandler.h +++ b/Source/CTest/cmCTestScriptHandler.h @@ -110,7 +110,7 @@ public: void CreateCMake(); void GetCommandDocumentation(std::vector<cmDocumentationEntry>& v) const; - + cmake* GetCMake() { return this->CMake;} private: // reads in a script int ReadInScript(const std::string& total_script_arg); diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 15f1178..cbead3c 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1309,9 +1309,40 @@ void cmCTest::StartXML(std::ostream& ostr) << "\tProcessorClockFrequency=\"" << info.GetProcessorClockFrequency() << "\"\n" << ">" << std::endl; + this->AddSiteProperties(ostr); } //---------------------------------------------------------------------- +void cmCTest::AddSiteProperties(std::ostream& ostr) +{ + cmCTestScriptHandler* ch = + static_cast<cmCTestScriptHandler*>(this->GetHandler("script")); + const char* subproject = + ch->GetCMake()->GetProperty("SubProject", cmProperty::GLOBAL); + if(subproject) + { + ostr << "<Subproject name=\"" << subproject << "\">\n"; + const char* labels = + ch->GetCMake()->GetProperty("SubProjectLabels", cmProperty::GLOBAL); + if(labels) + { + ostr << " <Labels>\n"; + std::string l = labels; + std::vector<std::string> args; + cmSystemTools::ExpandListArgument(l, args); + for(std::vector<std::string>::iterator i = args.begin(); + i != args.end(); ++i) + { + ostr << " <Label>" << i->c_str() << "</Label>\n"; + } + ostr << " </Labels>\n"; + } + ostr << "</Subproject>\n"; + } +} + + +//---------------------------------------------------------------------- void cmCTest::EndXML(std::ostream& ostr) { ostr << "</Site>" << std::endl; @@ -1323,16 +1354,17 @@ int cmCTest::GenerateCTestNotesOutput(std::ostream& os, { cmCTest::VectorOfStrings::const_iterator it; os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" - << "<?xml-stylesheet type=\"text/xsl\" " + << "<?xml-stylesheet type=\"text/xsl\" " "href=\"Dart/Source/Server/XSL/Build.xsl " "<file:///Dart/Source/Server/XSL/Build.xsl> \"?>\n" - << "<Site BuildName=\"" << this->GetCTestConfiguration("BuildName") - << "\" BuildStamp=\"" - << this->CurrentTag << "-" << this->GetTestModelString() << "\" Name=\"" - << this->GetCTestConfiguration("Site") << "\" Generator=\"ctest" - << cmVersion::GetCMakeVersion() - << "\">\n" - << "<Notes>" << std::endl; + << "<Site BuildName=\"" << this->GetCTestConfiguration("BuildName") + << "\" BuildStamp=\"" + << this->CurrentTag << "-" << this->GetTestModelString() << "\" Name=\"" + << this->GetCTestConfiguration("Site") << "\" Generator=\"ctest" + << cmVersion::GetCMakeVersion() + << "\">\n"; + this->AddSiteProperties(os); + os << "<Notes>" << std::endl; for ( it = files.begin(); it != files.end(); it ++ ) { diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 10a7d5b..adfafdf 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -27,6 +27,7 @@ class cmMakefile; class cmCTestGenericHandler; class cmGeneratedFileStream; class cmCTestCommand; +class cmCTestScriptHandler; #define cmCTestLog(ctSelf, logType, msg) \ do { \ @@ -171,6 +172,7 @@ public: ///! The max output width int GetMaxTestNameWidth() const; + int SetMaxTestNameWidth(int w) { this->MaxTestNameWidth = w;} /** * Run a single executable command and put the stdout and stderr @@ -335,6 +337,7 @@ public: /** Direct process output to given streams. */ void SetStreams(std::ostream* out, std::ostream* err) { this->StreamOut = out; this->StreamErr = err; } + void AddSiteProperties(std::ostream& ); private: std::string ConfigType; bool Verbose; |