MCPcopy Create free account
hub / github.com/Kitware/CMake / ProcessMemCheckPurifyOutput

Method ProcessMemCheckPurifyOutput

Source/CTest/cmCTestMemCheckHandler.cxx:866–907  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

864 return defects == 0;
865}
866bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput(
867 std::string const& str, std::string& log, std::vector<int>& results)
868{
869 std::vector<std::string> lines;
870 cmsys::SystemTools::Split(str, lines);
871 std::ostringstream ostr;
872 log.clear();
873
874 cmsys::RegularExpression pfW("^\\[[WEI]\\] ([A-Z][A-Z][A-Z][A-Z]*): ");
875
876 int defects = 0;
877
878 for (std::string const& l : lines) {
879 std::vector<int>::size_type failure = this->ResultStrings.size();
880 if (pfW.find(l)) {
881 std::vector<int>::size_type cc;
882 for (cc = 0; cc < this->ResultStrings.size(); cc++) {
883 if (pfW.match(1) == this->ResultStrings[cc]) {
884 failure = cc;
885 break;
886 }
887 }
888 if (cc == this->ResultStrings.size()) {
889 cmCTestLog(this->CTest, ERROR_MESSAGE,
890 "Unknown Purify memory fault: " << pfW.match(1)
891 << std::endl);
892 ostr << "*** Unknown Purify memory fault: " << pfW.match(1)
893 << std::endl;
894 }
895 }
896 if (failure != this->ResultStrings.size()) {
897 ostr << "<b>" << this->ResultStrings[failure] << "</b> ";
898 results[failure]++;
899 defects++;
900 }
901 ostr << l << std::endl;
902 }
903
904 log = ostr.str();
905 this->DefectCount += defects;
906 return defects == 0;
907}
908
909bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput(
910 std::string const& str, std::string& log, std::vector<int>& results)

Callers 1

ProcessMemCheckOutputMethod · 0.95

Calls 5

strMethod · 0.80
clearMethod · 0.45
sizeMethod · 0.45
findMethod · 0.45
matchMethod · 0.45

Tested by

no test coverage detected