summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx52
-rw-r--r--Source/CTest/cmCTestTestHandler.h1
-rw-r--r--Source/cmCTest.cxx2
3 files changed, 53 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 2ff8e30..62b111f 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -658,6 +658,58 @@ int cmCTestTestHandler::ProcessHandler()
}
//----------------------------------------------------------------------
+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" );
+ if ( this->LogFile )
+ {
+ *this->LogFile << "\nTime in " << *i << " = "
+ << labelTimes[*i] << " sec" << std::endl;
+ }
+ }
+}
+
+//----------------------------------------------------------------------
void cmCTestTestHandler::ProcessOneTest(cmCTestTestProperties *it,
std::vector<cmStdString> &passed,
std::vector<cmStdString> &failed,
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h
index fe16e82..03ce285 100644
--- a/Source/CTest/cmCTestTestHandler.h
+++ b/Source/CTest/cmCTestTestHandler.h
@@ -186,6 +186,7 @@ private:
*/
virtual void GenerateDartOutput(std::ostream& os);
+ void PrintLabelSummary();
/**
* Run the tests for a directory and any subdirectories
*/
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 0b74107..abf47a2 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1192,7 +1192,6 @@ int cmCTest::RunTest(std::vector<const char*> argv,
{
if ( output )
{
- //ZACH: need to grab the output here
tempOutput.insert(tempOutput.end(), data, data+length);
}
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, cmCTestLogWrite(data, length));
@@ -1205,7 +1204,6 @@ int cmCTest::RunTest(std::vector<const char*> argv,
cmsysProcess_WaitForExit(cp, 0);
if(output && tempOutput.begin() != tempOutput.end())
{
- //We are waiting for exit before finally appending to the output
output->append(&*tempOutput.begin(), tempOutput.size());
}
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "-- Process completed"