diff options
author | Betsy McPhail <betsy.mcphail@kitware.com> | 2017-06-27 19:23:18 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-07-10 20:25:18 (GMT) |
commit | d08ec4d25a8113388092bf342002f3859f6b8de4 (patch) | |
tree | 9e07c94036183d61f702a38a85531da58feb56db /Source/cmCTest.cxx | |
parent | c705f0af63e2e438d0c6de2400cd90a005576125 (diff) | |
download | CMake-d08ec4d25a8113388092bf342002f3859f6b8de4.zip CMake-d08ec4d25a8113388092bf342002f3859f6b8de4.tar.gz CMake-d08ec4d25a8113388092bf342002f3859f6b8de4.tar.bz2 |
Add CTEST_LABELS_FOR_SUBPROJECTS as a CTest module and script variable
Use this variable to specify a list of labels that will be reported to
CDash as subprojects.
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r-- | Source/cmCTest.cxx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index e260556..1eedaf1 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -11,6 +11,7 @@ #include "cmsys/Process.h" #include "cmsys/String.hxx" #include "cmsys/SystemInformation.hxx" +#include <algorithm> #include <ctype.h> #include <iostream> #include <map> @@ -1363,6 +1364,35 @@ void cmCTest::AddSiteProperties(cmXMLWriter& xml) } } +void cmCTest::GenerateSubprojectsOutput(cmXMLWriter& xml) +{ + std::vector<std::string> subprojects = this->GetLabelsForSubprojects(); + std::vector<std::string>::const_iterator i; + for (i = subprojects.begin(); i != subprojects.end(); ++i) { + xml.StartElement("Subproject"); + xml.Attribute("name", *i); + xml.Element("Label", *i); + xml.EndElement(); // Subproject + } +} + +std::vector<std::string> cmCTest::GetLabelsForSubprojects() +{ + std::string labelsForSubprojects = + this->GetCTestConfiguration("LabelsForSubprojects"); + std::vector<std::string> subprojects; + cmSystemTools::ExpandListArgument(labelsForSubprojects, subprojects); + + // sort the array + std::sort(subprojects.begin(), subprojects.end()); + // remove duplicates + std::vector<std::string>::iterator new_end = + std::unique(subprojects.begin(), subprojects.end()); + subprojects.erase(new_end, subprojects.end()); + + return subprojects; +} + void cmCTest::EndXML(cmXMLWriter& xml) { xml.EndElement(); // Site |