summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-01-07 15:41:37 (GMT)
committerBrad King <brad.king@kitware.com>2009-01-07 15:41:37 (GMT)
commit377bebb9101b2bcf67e92143243fe26dba8abf6d (patch)
treed69e028a930d59ce7a638abd53f831bfc8f01224
parent605f4bd34edff8a48e8d27c42fd5c264f010b1fb (diff)
downloadCMake-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.
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx41
-rw-r--r--Source/CTest/cmCTestTestHandler.h1
-rw-r--r--Source/cmTest.cxx5
3 files changed, 46 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("=");
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h
index 0b5fa09..e9b08cd 100644
--- a/Source/CTest/cmCTestTestHandler.h
+++ b/Source/CTest/cmCTestTestHandler.h
@@ -95,6 +95,7 @@ public:
double Timeout;
int Index;
std::vector<std::string> Environment;
+ std::vector<std::string> Labels;
};
struct cmCTestTestResult
diff --git a/Source/cmTest.cxx b/Source/cmTest.cxx
index 2abebd8..c7b1637 100644
--- a/Source/cmTest.cxx
+++ b/Source/cmTest.cxx
@@ -110,6 +110,11 @@ void cmTest::DefineProperties(cmake *cm)
"For example: PASS_REGULAR_EXPRESSION \"[^a-z]Error;ERROR;Failed\"");
cm->DefineProperty
+ ("LABELS", cmProperty::TEST,
+ "Specify a list of text labels associated with a test.",
+ "The list is reported in dashboard submissions.");
+
+ cm->DefineProperty
("MEASUREMENT", cmProperty::TEST,
"Specify a DART measurement and value to be reported for a test.",
"If set to a name then that name will be reported to DART as a "