Commit ed387ffe authored by Bill Hoffman's avatar Bill Hoffman
Browse files

ENH: add subproject tag property for ctest

parent 86b103f2
......@@ -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);
......
......@@ -1309,8 +1309,39 @@ 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)
{
......@@ -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 ++ )
{
......
......@@ -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;
......
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