| 1313 | } |
| 1314 | |
| 1315 | void cmCTestMemCheckHandler::PostProcessDrMemoryTest( |
| 1316 | cmCTestTestHandler::cmCTestTestResult& res, int test) |
| 1317 | { |
| 1318 | std::string drMemoryLogDir = this->MemoryTesterOutputFile.substr( |
| 1319 | 0, this->MemoryTesterOutputFile.find("/*/results.txt")); |
| 1320 | |
| 1321 | // replace placeholder of test |
| 1322 | std::string::size_type pos = drMemoryLogDir.find("??"); |
| 1323 | if (pos != std::string::npos) { |
| 1324 | drMemoryLogDir.replace(pos, 2, std::to_string(test)); |
| 1325 | } |
| 1326 | |
| 1327 | cmsys::Glob g; |
| 1328 | g.FindFiles(drMemoryLogDir + "/resfile.*"); |
| 1329 | std::vector<std::string> const& files = g.GetFiles(); |
| 1330 | |
| 1331 | for (std::string const& f : files) { |
| 1332 | cmsys::ifstream ifs(f.c_str()); |
| 1333 | if (!ifs) { |
| 1334 | std::string log = "Cannot read memory tester output file: " + f; |
| 1335 | cmCTestLog(this->CTest, ERROR_MESSAGE, log << std::endl); |
| 1336 | return; |
| 1337 | } |
| 1338 | std::string resultFileLocation; |
| 1339 | cmSystemTools::GetLineFromStream(ifs, resultFileLocation); |
| 1340 | this->AppendMemTesterOutput(res, resultFileLocation); |
| 1341 | ifs.close(); |
| 1342 | cmSystemTools::RemoveFile(f); |
| 1343 | } |
| 1344 | } |
| 1345 | |
| 1346 | void cmCTestMemCheckHandler::AppendMemTesterOutput(cmCTestTestResult& res, |
| 1347 | std::string const& ofile) |
no test coverage detected