If labels are found on the tests, then print a time summary for all the tests run with each label.
This commit is contained in:
parent
154a35c7bc
commit
3c34d0440c
|
@ -589,7 +589,7 @@ int cmCTestTestHandler::ProcessHandler()
|
|||
cmCTestTestResult *result = &this->TestResults[cc];
|
||||
totalTestTime += result->ExecutionTime;
|
||||
}
|
||||
|
||||
this->PrintLabelSummary();
|
||||
char buf[1024];
|
||||
sprintf(buf, "%6.2f sec", totalTestTime);
|
||||
cmCTestLog(this->CTest, HANDLER_OUTPUT, "\nTotal Test time = "
|
||||
|
@ -656,6 +656,53 @@ int cmCTestTestHandler::ProcessHandler()
|
|||
return 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void cmCTestTestHandler::PrintLabelSummary()
|
||||
{
|
||||
cmCTestTestHandler::ListOfTests::iterator it = this->TestList.begin();
|
||||
cmCTestTestHandler::TestResultsVector::iterator ri =
|
||||
this->TestResults.begin();
|
||||
std::map<cmStdString, double> labelTimes;
|
||||
std::set<cmStdString> labels;
|
||||
// initialize maps
|
||||
for(; it != this->TestList.end(); ++it)
|
||||
{
|
||||
cmCTestTestProperties& p = *it;
|
||||
if(p.Labels.size() != 0)
|
||||
{
|
||||
for(std::vector<std::string>::iterator l = p.Labels.begin();
|
||||
l != p.Labels.end(); ++l)
|
||||
{
|
||||
labels.insert(*l);
|
||||
labelTimes[*l] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
it = this->TestList.begin();
|
||||
ri = this->TestResults.begin();
|
||||
// fill maps
|
||||
for(; it != this->TestList.end(); ++it, ++ri)
|
||||
{
|
||||
cmCTestTestProperties& p = *it;
|
||||
cmCTestTestResult &result = *ri;
|
||||
if(p.Labels.size() != 0)
|
||||
{
|
||||
for(std::vector<std::string>::iterator l = p.Labels.begin();
|
||||
l != p.Labels.end(); ++l)
|
||||
{
|
||||
labelTimes[*l] += result.ExecutionTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
// now print times
|
||||
for(std::set<cmStdString>::const_iterator i = labels.begin();
|
||||
i != labels.end(); ++i)
|
||||
{
|
||||
cmCTestLog(this->CTest, HANDLER_OUTPUT, "\nTime in "
|
||||
<< *i << " = " << labelTimes[*i] << " sec" );
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void cmCTestTestHandler::ProcessOneTest(cmCTestTestProperties *it,
|
||||
std::vector<cmStdString> &passed,
|
||||
|
|
|
@ -185,6 +185,7 @@ private:
|
|||
*/
|
||||
virtual void GenerateDartOutput(std::ostream& os);
|
||||
|
||||
void PrintLabelSummary();
|
||||
/**
|
||||
* Run the tests for a directory and any subdirectories
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue