diff options
author | Brad King <brad.king@kitware.com> | 2009-01-07 15:41:37 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-01-07 15:41:37 (GMT) |
commit | 377bebb9101b2bcf67e92143243fe26dba8abf6d (patch) | |
tree | d69e028a930d59ce7a638abd53f831bfc8f01224 /Source/CTest/cmCTestTestHandler.cxx | |
parent | 605f4bd34edff8a48e8d27c42fd5c264f010b1fb (diff) | |
download | CMake-377bebb9101b2bcf67e92143243fe26dba8abf6d.zip CMake-377bebb9101b2bcf67e92143243fe26dba8abf6d.tar.gz CMake-377bebb9101b2bcf67e92143243fe26dba8abf6d.tar.bz2 |
ENH: Teach CTest to submit test property LABELS
This teaches CTest to send the test property "LABELS" in Test.xml
dashboard submissions as Label elements inside a Labels element.
Diffstat (limited to 'Source/CTest/cmCTestTestHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 46ab467..68c5855 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1224,6 +1224,14 @@ void cmCTestTestHandler::LoadTestList() cmSystemTools::GetLineFromStream(fin, line); p.Environment.push_back(line); } + int numLabels = 0; + ok = ok && this->GetValue("Labels:", + numLabels, fin); + for(int j =0; j < numLabels; j++) + { + cmSystemTools::GetLineFromStream(fin, line); + p.Labels.push_back(line); + } if(!ok) { cmCTestLog(this->CTest, ERROR_MESSAGE, @@ -1316,6 +1324,13 @@ std::string cmCTestTestHandler::SaveTestList() { fout << *e << "\n"; } + fout << "Labels:\n" << + p.Labels.size() << "\n"; + for(std::vector<std::string>::const_iterator e = + p.Labels.begin(); e != p.Labels.end(); ++e) + { + fout << *e << "\n"; + } } fout.close(); return fname; @@ -1513,7 +1528,21 @@ void cmCTestTestHandler::GenerateDartOutput(std::ostream& os) os << "</Value>\n" << "\t\t\t</Measurement>\n" - << "\t\t</Results>\n" + << "\t\t</Results>\n"; + + if(!result->Properties->Labels.empty()) + { + os << "\t\t<Labels>\n"; + std::vector<std::string> const& labels = result->Properties->Labels; + for(std::vector<std::string>::const_iterator li = labels.begin(); + li != labels.end(); ++li) + { + os << "\t\t\t<Label>" << cmCTest::MakeXMLSafe(*li) << "</Label>\n"; + } + os << "\t\t</Labels>\n"; + } + + os << "\t</Test>" << std::endl; } @@ -2306,6 +2335,16 @@ bool cmCTestTestHandler::SetTestsProperties( rtit->Environment.push_back(*crit); } } + if ( key == "LABELS" ) + { + std::vector<std::string> lval; + cmSystemTools::ExpandListArgument(val.c_str(), lval); + std::vector<std::string>::iterator crit; + for ( crit = lval.begin(); crit != lval.end(); ++ crit ) + { + rtit->Labels.push_back(*crit); + } + } if ( key == "MEASUREMENT" ) { size_t pos = val.find_first_of("="); |