Commit 377bebb9 authored by Brad King's avatar Brad King
Browse files

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.
parent 605f4bd3
......@@ -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("=");
......
......@@ -95,6 +95,7 @@ public:
double Timeout;
int Index;
std::vector<std::string> Environment;
std::vector<std::string> Labels;
};
struct cmCTestTestResult
......
......@@ -109,6 +109,11 @@ void cmTest::DefineProperties(cmake *cm)
"specified regular expressions, the test will fail."
"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.",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment