| 864 | return defects == 0; |
| 865 | } |
| 866 | bool 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 | |
| 909 | bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput( |
| 910 | std::string const& str, std::string& log, std::vector<int>& results) |