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

Method OpenOutputFile

Source/cmCTest.cxx:645–680  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

643}
644
645bool cmCTest::OpenOutputFile(std::string const& path, std::string const& name,
646 cmGeneratedFileStream& stream, bool compress)
647{
648 std::string testingDir = this->Impl->BinaryDir + "/Testing";
649 if (!path.empty()) {
650 testingDir += "/" + path;
651 }
652 if (cmSystemTools::FileExists(testingDir)) {
653 if (!cmSystemTools::FileIsDirectory(testingDir)) {
654 cmCTestLog(this, ERROR_MESSAGE,
655 "File " << testingDir
656 << " is in the place of the testing directory"
657 << std::endl);
658 return false;
659 }
660 } else {
661 if (!cmSystemTools::MakeDirectory(testingDir)) {
662 cmCTestLog(this, ERROR_MESSAGE,
663 "Cannot create directory " << testingDir << std::endl);
664 return false;
665 }
666 }
667 std::string filename = cmStrCat(testingDir, '/', name);
668 stream.Open(filename);
669 if (!stream) {
670 cmCTestLog(this, ERROR_MESSAGE,
671 "Problem opening file: " << filename << std::endl);
672 return false;
673 }
674 if (compress) {
675 if (this->Impl->CompressXMLFiles) {
676 stream.SetCompression(true);
677 }
678 }
679 return true;
680}
681
682bool cmCTest::AddIfExists(Part part, std::string const& file)
683{

Callers 6

GenerateNotesFileMethod · 0.95
GenerateDoneFileMethod · 0.95
StartResultingXMLMethod · 0.95
StartLogFileMethod · 0.95
ExecuteUpdateMethod · 0.80
ExecuteUploadMethod · 0.80

Calls 5

SetCompressionMethod · 0.80
cmStrCatFunction · 0.70
FileExistsFunction · 0.50
emptyMethod · 0.45
OpenMethod · 0.45

Tested by

no test coverage detected