diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2015-05-23 23:00:12 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-05-26 14:40:00 (GMT) |
commit | b26e5b552a53521ba06d27835cac2a6f72d70dfc (patch) | |
tree | 0de35df30a489e4475b907f1d493e0f0607afcf7 | |
parent | 965cf8e66e8316f34113c219d9311edee34bfd3b (diff) | |
download | CMake-b26e5b552a53521ba06d27835cac2a6f72d70dfc.zip CMake-b26e5b552a53521ba06d27835cac2a6f72d70dfc.tar.gz CMake-b26e5b552a53521ba06d27835cac2a6f72d70dfc.tar.bz2 |
CTest: Generate NamedMeasurement elements directly into xml file
Re-order the logic to avoid use of a temporary std::ostringstream.
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 4 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 8 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.h | 4 |
3 files changed, 6 insertions, 10 deletions
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index d7da2b4..d9e4bd4 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -607,7 +607,7 @@ void cmCTestRunTest::DartProcessing() { if (this->TestHandler->DartStuff.find(this->ProcessOutput.c_str())) { - std::string dartString = this->TestHandler->DartStuff.match(1); + this->TestResult.DartString = this->TestHandler->DartStuff.match(1); // keep searching and replacing until none are left while (this->TestHandler->DartStuff1.find(this->ProcessOutput.c_str())) { @@ -615,8 +615,6 @@ void cmCTestRunTest::DartProcessing() cmSystemTools::ReplaceString(this->ProcessOutput, this->TestHandler->DartStuff1.match(1).c_str(), ""); } - this->TestResult.RegressionImages - = this->TestHandler->GenerateRegressionImages(dartString); } } } diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index b1c479e..aa68461 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1185,7 +1185,7 @@ void cmCTestTestHandler::GenerateDartOutput(std::ostream& os) << "</Value></NamedMeasurement>" << std::endl; } - os << result->RegressionImages; + this->GenerateRegressionImages(os, result->DartString); os << "\t\t\t<NamedMeasurement type=\"numeric/double\" " << "name=\"Execution Time\"><Value>" << result->ExecutionTime @@ -1828,8 +1828,8 @@ void cmCTestTestHandler::ExpandTestsToRunInformationForRerunFailed() // Just for convenience #define SPACE_REGEX "[ \t\r\n]" //---------------------------------------------------------------------- -std::string cmCTestTestHandler::GenerateRegressionImages( - const std::string& xml) +void cmCTestTestHandler::GenerateRegressionImages( + std::ostream& ostr, const std::string& xml) { cmsys::RegularExpression twoattributes( "<DartMeasurement" @@ -1864,7 +1864,6 @@ std::string cmCTestTestHandler::GenerateRegressionImages( SPACE_REGEX "*(name|type|encoding|compression)=\"([^\"]*)\"" SPACE_REGEX "*>([^<]*)</DartMeasurementFile>"); - std::ostringstream ostr; bool done = false; std::string cxml = xml; while ( ! done ) @@ -2026,7 +2025,6 @@ std::string cmCTestTestHandler::GenerateRegressionImages( done = true; } } - return ostr.str(); } //---------------------------------------------------------------------- diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h index fe43bb8..623c996 100644 --- a/Source/CTest/cmCTestTestHandler.h +++ b/Source/CTest/cmCTestTestHandler.h @@ -128,7 +128,7 @@ public: bool CompressOutput; std::string CompletionStatus; std::string Output; - std::string RegressionImages; + std::string DartString; int TestCount; cmCTestTestProperties* Properties; }; @@ -270,7 +270,7 @@ private: cmsys::RegularExpression IncludeTestsRegularExpression; cmsys::RegularExpression ExcludeTestsRegularExpression; - std::string GenerateRegressionImages(const std::string& xml); + void GenerateRegressionImages(std::ostream& ostr, const std::string& xml); cmsys::RegularExpression DartStuff1; void CheckLabelFilter(cmCTestTestProperties& it); void CheckLabelFilterExclude(cmCTestTestProperties& it); |