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

Method PostProcessDrMemoryTest

Source/CTest/cmCTestMemCheckHandler.cxx:1315–1344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1313}
1314
1315void 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
1346void cmCTestMemCheckHandler::AppendMemTesterOutput(cmCTestTestResult& res,
1347 std::string const& ofile)

Callers 1

PostProcessTestMethod · 0.95

Calls 8

AppendMemTesterOutputMethod · 0.95
to_stringFunction · 0.85
FindFilesMethod · 0.80
c_strMethod · 0.80
substrMethod · 0.45
findMethod · 0.45
GetFilesMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected