mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-03 04:40:18 -05:00
Added CTest command --print-labels
This command allows a user to quickly see the list of all available test labels. The labels are also printed in verbose show only mode, alongside their corresponding tests.
This commit is contained in:
@@ -516,11 +516,13 @@ void cmCTestMultiProcessHandler::PrintTestList()
|
||||
{
|
||||
this->TestHandler->SetMaxIndex(this->FindMaxIndex());
|
||||
int count = 0;
|
||||
|
||||
for (PropertiesMap::iterator it = this->Properties.begin();
|
||||
it != this->Properties.end(); ++it)
|
||||
{
|
||||
count++;
|
||||
cmCTestTestHandler::cmCTestTestProperties& p = *it->second;
|
||||
|
||||
//push working dir
|
||||
std::string current_dir = cmSystemTools::GetCurrentWorkingDirectory();
|
||||
cmSystemTools::ChangeDirectory(p.Directory.c_str());
|
||||
@@ -530,6 +532,20 @@ void cmCTestMultiProcessHandler::PrintTestList()
|
||||
testRun.SetTestProperties(&p);
|
||||
testRun.ComputeArguments(); //logs the command in verbose mode
|
||||
|
||||
if(p.Labels.size()) //print the labels
|
||||
{
|
||||
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Labels:");
|
||||
}
|
||||
for(std::vector<std::string>::iterator label = p.Labels.begin();
|
||||
label != p.Labels.end(); ++label)
|
||||
{
|
||||
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " " << *label);
|
||||
}
|
||||
if(p.Labels.size()) //print the labels
|
||||
{
|
||||
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl);
|
||||
}
|
||||
|
||||
if (this->TestHandler->MemCheck)
|
||||
{
|
||||
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Memory Check");
|
||||
@@ -548,10 +564,36 @@ void cmCTestMultiProcessHandler::PrintTestList()
|
||||
//pop working dir
|
||||
cmSystemTools::ChangeDirectory(current_dir.c_str());
|
||||
}
|
||||
|
||||
cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl << "Total Tests: "
|
||||
<< this->Total << std::endl);
|
||||
}
|
||||
|
||||
void cmCTestMultiProcessHandler::PrintLabels()
|
||||
{
|
||||
std::set<std::string> allLabels;
|
||||
for (PropertiesMap::iterator it = this->Properties.begin();
|
||||
it != this->Properties.end(); ++it)
|
||||
{
|
||||
cmCTestTestHandler::cmCTestTestProperties& p = *it->second;
|
||||
allLabels.insert(p.Labels.begin(), p.Labels.end());
|
||||
}
|
||||
|
||||
if(allLabels.size())
|
||||
{
|
||||
cmCTestLog(this->CTest, HANDLER_OUTPUT, "All Labels:" << std::endl);
|
||||
}
|
||||
else
|
||||
{
|
||||
cmCTestLog(this->CTest, HANDLER_OUTPUT, "No Labels Exist" << std::endl);
|
||||
}
|
||||
for(std::set<std::string>::iterator label = allLabels.begin();
|
||||
label != allLabels.end(); ++label)
|
||||
{
|
||||
cmCTestLog(this->CTest, HANDLER_OUTPUT, " " << *label << std::endl);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
void cmCTestMultiProcessHandler::CheckResume()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user