| 1377 | } |
| 1378 | |
| 1379 | void cmCTestMemCheckHandler::TestOutputFileNames( |
| 1380 | int test, std::vector<std::string>& files) |
| 1381 | { |
| 1382 | std::string index = std::to_string(test); |
| 1383 | std::string ofile = this->MemoryTesterOutputFile; |
| 1384 | std::string::size_type pos = ofile.find("??"); |
| 1385 | ofile.replace(pos, 2, index); |
| 1386 | if (this->LogWithPID) { |
| 1387 | ofile += ".*"; |
| 1388 | cmsys::Glob g; |
| 1389 | g.FindFiles(ofile); |
| 1390 | if (g.GetFiles().empty()) { |
| 1391 | std::string log = "Cannot find memory tester output file: " + ofile; |
| 1392 | cmCTestLog(this->CTest, WARNING, log << std::endl); |
| 1393 | ofile.clear(); |
| 1394 | } else { |
| 1395 | files = g.GetFiles(); |
| 1396 | return; |
| 1397 | } |
| 1398 | } else if (!cmSystemTools::FileExists(ofile)) { |
| 1399 | std::string log = "Cannot find memory tester output file: " + ofile; |
| 1400 | cmCTestLog(this->CTest, WARNING, log << std::endl); |
| 1401 | ofile.clear(); |
| 1402 | } |
| 1403 | files.push_back(std::move(ofile)); |
| 1404 | } |