diff options
Diffstat (limited to 'Source/CTest')
31 files changed, 573 insertions, 452 deletions
diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx index 0152200..365f267 100644 --- a/Source/CTest/cmCTestBZR.cxx +++ b/Source/CTest/cmCTestBZR.cxx @@ -155,8 +155,9 @@ bool cmCTestBZR::NoteOldRevision() { this->OldRevision = this->LoadInfo(); this->Log << "Revision before update: " << this->OldRevision << "\n"; - cmCTestLog(this->CTest, HANDLER_OUTPUT, " Old revision of repository is: " - << this->OldRevision << "\n"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " Old revision of repository is: " << this->OldRevision + << "\n"); this->PriorRev.Rev = this->OldRevision; return true; } @@ -165,14 +166,16 @@ bool cmCTestBZR::NoteNewRevision() { this->NewRevision = this->LoadInfo(); this->Log << "Revision after update: " << this->NewRevision << "\n"; - cmCTestLog(this->CTest, HANDLER_OUTPUT, " New revision of repository is: " - << this->NewRevision << "\n"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " New revision of repository is: " << this->NewRevision + << "\n"); this->Log << "URL = " << this->URL << "\n"; return true; } -class cmCTestBZR::LogParser : public cmCTestVC::OutputLogger, - private cmXMLParser +class cmCTestBZR::LogParser + : public cmCTestVC::OutputLogger + , private cmXMLParser { public: LogParser(cmCTestBZR* bzr, const char* prefix) diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index ce6fbc7..8527d54 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -299,7 +299,8 @@ int cmCTestBuildHandler::ProcessHandler() this->ErrorWarningFileLineRegex.push_back(std::move(r)); } else { cmCTestLog( - this->CTest, ERROR_MESSAGE, "Problem Compiling regular expression: " + this->CTest, ERROR_MESSAGE, + "Problem Compiling regular expression: " << cmCTestWarningErrorFileLine[entry].RegularExpressionString << std::endl); } @@ -331,8 +332,8 @@ int cmCTestBuildHandler::ProcessHandler() cmGeneratedFileStream ofs; auto elapsed_time_start = std::chrono::steady_clock::now(); if (!this->StartLogFile("Build", ofs)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot create build log file" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot create build log file" << std::endl); } // Create lists of regular expression strings for errors, error exceptions, @@ -352,7 +353,7 @@ int cmCTestBuildHandler::ProcessHandler() this->CustomWarningExceptions.push_back(cmCTestWarningExceptions[cc]); } -// Pre-compile regular expressions objects for all regular expressions + // Pre-compile regular expressions objects for all regular expressions #define cmCTestBuildHandlerPopulateRegexVector(strings, regexes) \ regexes.clear(); \ @@ -452,8 +453,8 @@ int cmCTestBuildHandler::ProcessHandler() // Generate XML output cmGeneratedFileStream xofs; if (!this->StartResultingXML(cmCTest::PartBuild, "Build", xofs)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot create build XML file" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot create build XML file" << std::endl); return -1; } cmXMLWriter xml(xofs); @@ -466,19 +467,20 @@ int cmCTestBuildHandler::ProcessHandler() this->GenerateXMLFooter(xml, elapsed_build_time); if (res != cmsysProcess_State_Exited || retVal || this->TotalErrors > 0) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Error(s) when building project" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Error(s) when building project" << std::endl); } // Display message about number of errors and warnings - cmCTestLog(this->CTest, HANDLER_OUTPUT, " " - << this->TotalErrors - << (this->TotalErrors >= this->MaxErrors ? " or more" : "") - << " Compiler errors" << std::endl); - cmCTestLog(this->CTest, HANDLER_OUTPUT, " " - << this->TotalWarnings - << (this->TotalWarnings >= this->MaxWarnings ? " or more" : "") - << " Compiler warnings" << std::endl); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " " << this->TotalErrors + << (this->TotalErrors >= this->MaxErrors ? " or more" : "") + << " Compiler errors" << std::endl); + cmCTestLog( + this->CTest, HANDLER_OUTPUT, + " " << this->TotalWarnings + << (this->TotalWarnings >= this->MaxWarnings ? " or more" : "") + << " Compiler warnings" << std::endl); return retVal; } @@ -779,8 +781,8 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal, } argv.push_back(nullptr); - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command:", - this->Quiet); + cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Run command:", this->Quiet); for (char const* arg : argv) { if (!arg) { break; @@ -812,7 +814,8 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal, cmProcessOutput processOutput(encoding); std::string strdata; cmCTestOptionalLog( - this->CTest, HANDLER_PROGRESS_OUTPUT, " Each symbol represents " + this->CTest, HANDLER_PROGRESS_OUTPUT, + " Each symbol represents " << tick_len << " bytes of output." << std::endl << (this->UseCTestLaunch ? "" @@ -868,7 +871,8 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal, &this->BuildProcessingQueue); this->ProcessBuffer(nullptr, 0, tick, tick_len, ofs, &this->BuildProcessingErrorQueue); - cmCTestOptionalLog(this->CTest, HANDLER_PROGRESS_OUTPUT, " Size of output: " + cmCTestOptionalLog(this->CTest, HANDLER_PROGRESS_OUTPUT, + " Size of output: " << ((this->BuildOutputLogSize + 512) / 1024) << "K" << std::endl, this->Quiet); @@ -921,8 +925,9 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal, errorwarning.Error = true; this->ErrorsAndWarnings.push_back(std::move(errorwarning)); this->TotalErrors++; - cmCTestLog(this->CTest, ERROR_MESSAGE, "There was an error: " - << cmsysProcess_GetErrorString(cp) << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "There was an error: " << cmsysProcess_GetErrorString(cp) + << std::endl); } cmsysProcess_Delete(cp); @@ -1049,7 +1054,8 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, size_t length, this->LastTickChar, this->Quiet); tickDisplayed = true; if (tick % tick_line_len == 0 && tick > 0) { - cmCTestOptionalLog(this->CTest, HANDLER_PROGRESS_OUTPUT, " Size: " + cmCTestOptionalLog(this->CTest, HANDLER_PROGRESS_OUTPUT, + " Size: " << ((this->BuildOutputLogSize + 512) / 1024) << "K" << std::endl << " ", @@ -1103,7 +1109,8 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data) for (cmsys::RegularExpression& rx : this->ErrorExceptionRegex) { if (rx.find(data)) { errorLine = 0; - cmCTestOptionalLog(this->CTest, DEBUG, " Not an error Line: " + cmCTestOptionalLog(this->CTest, DEBUG, + " Not an error Line: " << data << " (matches: " << this->CustomErrorExceptions[wrxCnt] << ")" << std::endl, @@ -1119,7 +1126,8 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data) for (cmsys::RegularExpression& rx : this->WarningMatchRegex) { if (rx.find(data)) { warningLine = 1; - cmCTestOptionalLog(this->CTest, DEBUG, " Warning Line: " + cmCTestOptionalLog(this->CTest, DEBUG, + " Warning Line: " << data << " (matches: " << this->CustomWarningMatches[wrxCnt] << ")" << std::endl, @@ -1134,7 +1142,8 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data) for (cmsys::RegularExpression& rx : this->WarningExceptionRegex) { if (rx.find(data)) { warningLine = 0; - cmCTestOptionalLog(this->CTest, DEBUG, " Not a warning Line: " + cmCTestOptionalLog(this->CTest, DEBUG, + " Not a warning Line: " << data << " (matches: " << this->CustomWarningExceptions[wrxCnt] << ")" << std::endl, diff --git a/Source/CTest/cmCTestCVS.cxx b/Source/CTest/cmCTestCVS.cxx index 5779935..4fb3273 100644 --- a/Source/CTest/cmCTestCVS.cxx +++ b/Source/CTest/cmCTestCVS.cxx @@ -134,8 +134,9 @@ private: bool ProcessLine() override { - if (this->Line == ("=======================================" - "======================================")) { + if (this->Line == + ("=======================================" + "======================================")) { // This line ends the revision list. if (this->Section == SectionRevisions) { this->FinishRevision(); diff --git a/Source/CTest/cmCTestConfigureHandler.cxx b/Source/CTest/cmCTestConfigureHandler.cxx index 821a94a..5967b74 100644 --- a/Source/CTest/cmCTestConfigureHandler.cxx +++ b/Source/CTest/cmCTestConfigureHandler.cxx @@ -51,8 +51,8 @@ int cmCTestConfigureHandler::ProcessHandler() if (!this->CTest->GetShowOnly()) { cmGeneratedFileStream os; if (!this->StartResultingXML(cmCTest::PartConfigure, "Configure", os)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open configure file" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot open configure file" << std::endl); return 1; } std::string start_time = this->CTest->CurrentTime(); diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index bafbe9a..43a2bae 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -197,10 +197,10 @@ bool cmCTestCoverageHandler::ShouldIDoCoverage(std::string const& file, for (cmsys::RegularExpression& rx : this->CustomCoverageExcludeRegex) { if (rx.find(file)) { - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " File " - << file << " is excluded in CTestCustom.ctest" - << std::endl; - , this->Quiet); + cmCTestOptionalLog( + this->CTest, HANDLER_VERBOSE_OUTPUT, + " File " << file << " is excluded in CTestCustom.ctest" << std::endl; + , this->Quiet); return false; } } @@ -391,8 +391,8 @@ int cmCTestCoverageHandler::ProcessHandler() if (!this->StartResultingXML(cmCTest::PartCoverage, "Coverage", covSumFile)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open coverage summary file." - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot open coverage summary file." << std::endl); return -1; } covSumFile.setf(std::ios::fixed, std::ios::floatfield); @@ -429,9 +429,10 @@ int cmCTestCoverageHandler::ProcessHandler() this->Quiet); file_count++; if (file_count % 50 == 0) { - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " processed: " - << file_count << " out of " - << cont.TotalCoverage.size() << std::endl, + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + " processed: " << file_count << " out of " + << cont.TotalCoverage.size() + << std::endl, this->Quiet); cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " ", this->Quiet); } @@ -524,8 +525,9 @@ int cmCTestCoverageHandler::ProcessHandler() float cper = 0; float cmet = 0; if (tested + untested > 0) { - cper = (100 * SAFEDIV(static_cast<float>(tested), - static_cast<float>(tested + untested))); + cper = (100 * + SAFEDIV(static_cast<float>(tested), + static_cast<float>(tested + untested))); cmet = (SAFEDIV(static_cast<float>(tested + 10), static_cast<float>(tested + untested + 10))); } @@ -629,14 +631,14 @@ int cmCTestCoverageHandler::ProcessHandler() covSumXML.EndElement(); // Coverage this->CTest->EndXML(covSumXML); - cmCTestLog(this->CTest, HANDLER_OUTPUT, "" - << std::endl - << "\tCovered LOC: " << total_tested << std::endl - << "\tNot covered LOC: " << total_untested << std::endl - << "\tTotal LOC: " << total_lines << std::endl - << "\tPercentage Coverage: " - << std::setiosflags(std::ios::fixed) << std::setprecision(2) - << (percent_coverage) << "%" << std::endl); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + "" << std::endl + << "\tCovered LOC: " << total_tested << std::endl + << "\tNot covered LOC: " << total_untested << std::endl + << "\tTotal LOC: " << total_lines << std::endl + << "\tPercentage Coverage: " + << std::setiosflags(std::ios::fixed) << std::setprecision(2) + << (percent_coverage) << "%" << std::endl); ofs << "\tCovered LOC: " << total_tested << std::endl << "\tNot covered LOC: " << total_untested << std::endl @@ -677,9 +679,9 @@ void cmCTestCoverageHandler::PopulateCustomVectors(cmMakefile* mf) // Compare file names: fnc(fn1) == fnc(fn2) // fnc == file name compare // #ifdef _WIN32 -#define fnc(s) cmSystemTools::LowerCase(s) +# define fnc(s) cmSystemTools::LowerCase(s) #else -#define fnc(s) s +# define fnc(s) s #endif bool IsFileInDir(const std::string& infile, const std::string& indir) @@ -1045,7 +1047,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage( continue; } if (retVal != 0) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Coverage command returned: " + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Coverage command returned: " << retVal << " while processing: " << f << std::endl); cmCTestLog(this->CTest, ERROR_MESSAGE, "Command produced error: " << cont->Error << std::endl); @@ -1077,8 +1080,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage( gcovStyle = 1; } if (gcovStyle != 1) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e1" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Unknown gcov output style e1" << std::endl); cont->Error++; break; } @@ -1090,8 +1093,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage( gcovStyle = 1; } if (gcovStyle != 1) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e2" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Unknown gcov output style e2" << std::endl); cont->Error++; break; } @@ -1102,8 +1105,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage( gcovStyle = 2; } if (gcovStyle != 2) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e3" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Unknown gcov output style e3" << std::endl); cont->Error++; break; } @@ -1115,8 +1118,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage( gcovStyle = 2; } if (gcovStyle != 2) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e4" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Unknown gcov output style e4" << std::endl); cont->Error++; break; } @@ -1125,8 +1128,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage( gcovStyle = 2; } if (gcovStyle != 2) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e5" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Unknown gcov output style e5" << std::endl); cont->Error++; break; } @@ -1137,8 +1140,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage( gcovStyle = 2; } if (gcovStyle != 2) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e6" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Unknown gcov output style e6" << std::endl); cont->Error++; break; } @@ -1152,37 +1155,40 @@ int cmCTestCoverageHandler::HandleGCovCoverage( gcovStyle = 2; } if (gcovStyle != 2) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e7" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Unknown gcov output style e7" << std::endl); cont->Error++; break; } - cmCTestOptionalLog(this->CTest, WARNING, "Warning: Cannot open file: " - << st2re5.match(1) << std::endl, + cmCTestOptionalLog(this->CTest, WARNING, + "Warning: Cannot open file: " << st2re5.match(1) + << std::endl, this->Quiet); } else if (st2re6.find(line.c_str())) { if (gcovStyle == 0) { gcovStyle = 2; } if (gcovStyle != 2) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e8" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Unknown gcov output style e8" << std::endl); cont->Error++; break; } - cmCTestOptionalLog(this->CTest, WARNING, "Warning: File: " - << st2re6.match(1) << " is newer than " - << st2re6.match(2) << std::endl, + cmCTestOptionalLog(this->CTest, WARNING, + "Warning: File: " << st2re6.match(1) + << " is newer than " + << st2re6.match(2) << std::endl, this->Quiet); } else { // gcov 4.7 can have output lines saying "No executable lines" and // "Removing 'filename.gcov'"... Don't log those as "errors." if (line != "No executable lines" && !cmSystemTools::StringStartsWith(line.c_str(), "Removing ")) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output line: [" - << line << "]" << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Unknown gcov output line: [" << line << "]" + << std::endl); cont->Error++; // abort(); } @@ -1418,7 +1424,8 @@ int cmCTestCoverageHandler::HandleLCovCoverage( continue; } if (retVal != 0) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Coverage command returned: " + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Coverage command returned: " << retVal << " while processing: " << f << std::endl); cmCTestLog(this->CTest, ERROR_MESSAGE, "Command produced error: " << cont->Error << std::endl); @@ -1817,7 +1824,8 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch( "run covbr: " << std::endl, this->Quiet); if (!this->RunBullseyeCommand(cont, "covbr", nullptr, outputFile)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "error running covbr for." + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error running covbr for." << "\n"); return -1; } @@ -1981,8 +1989,8 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary( cmXMLWriter xml(covSumFile); if (!this->StartResultingXML(cmCTest::PartCoverage, "Coverage", covSumFile)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open coverage summary file." - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot open coverage summary file." << std::endl); return 0; } this->CTest->StartXML(xml, this->AppendXML); @@ -2198,7 +2206,8 @@ bool cmCTestCoverageHandler::ParseBullsEyeCovsrcLine( } // should be at the end now if (pos != std::string::npos) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Error parsing input : " + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Error parsing input : " << inputLine << " last pos not npos = " << pos << "\n"); } return true; diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx index 7b5ea60..f7b5930 100644 --- a/Source/CTest/cmCTestCurl.cxx +++ b/Source/CTest/cmCTestCurl.cxx @@ -175,7 +175,8 @@ bool cmCTestCurl::UploadFile(std::string const& local_file, "Curl debug: [" << curlDebug << "]\n", this->Quiet); } if (response.empty()) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "No response from server.\n" + cmCTestLog(this->CTest, ERROR_MESSAGE, + "No response from server.\n" << curlDebug); return false; } @@ -186,7 +187,8 @@ bool cmCTestCurl::HttpRequest(std::string const& url, std::string const& fields, std::string& response) { response.clear(); - cmCTestOptionalLog(this->CTest, DEBUG, "HttpRequest\n" + cmCTestOptionalLog(this->CTest, DEBUG, + "HttpRequest\n" << "url: " << url << "\n" << "fields " << fields << "\n", this->Quiet); diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx index e85af5e..b919c79 100644 --- a/Source/CTest/cmCTestGIT.cxx +++ b/Source/CTest/cmCTestGIT.cxx @@ -70,8 +70,9 @@ std::string cmCTestGIT::GetWorkingRevision() bool cmCTestGIT::NoteOldRevision() { this->OldRevision = this->GetWorkingRevision(); - cmCTestLog(this->CTest, HANDLER_OUTPUT, " Old revision of repository is: " - << this->OldRevision << "\n"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " Old revision of repository is: " << this->OldRevision + << "\n"); this->PriorRev.Rev = this->OldRevision; return true; } @@ -79,8 +80,9 @@ bool cmCTestGIT::NoteOldRevision() bool cmCTestGIT::NoteNewRevision() { this->NewRevision = this->GetWorkingRevision(); - cmCTestLog(this->CTest, HANDLER_OUTPUT, " New revision of repository is: " - << this->NewRevision << "\n"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " New revision of repository is: " << this->NewRevision + << "\n"); return true; } diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx index ce8f709..dc1bba0 100644 --- a/Source/CTest/cmCTestGenericHandler.cxx +++ b/Source/CTest/cmCTestGenericHandler.cxx @@ -100,8 +100,9 @@ bool cmCTestGenericHandler::StartResultingXML(cmCTest::Part part, } if (!this->CTest->OpenOutputFile(this->CTest->GetCurrentTag(), ostr.str(), xofs, true)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot create resulting XML file: " - << ostr.str() << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot create resulting XML file: " << ostr.str() + << std::endl); return false; } this->CTest->AddSubmitFile(part, ostr.str().c_str()); diff --git a/Source/CTest/cmCTestHG.cxx b/Source/CTest/cmCTestHG.cxx index 525dacc..c3c5da4 100644 --- a/Source/CTest/cmCTestHG.cxx +++ b/Source/CTest/cmCTestHG.cxx @@ -107,8 +107,9 @@ std::string cmCTestHG::GetWorkingRevision() bool cmCTestHG::NoteOldRevision() { this->OldRevision = this->GetWorkingRevision(); - cmCTestLog(this->CTest, HANDLER_OUTPUT, " Old revision of repository is: " - << this->OldRevision << "\n"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " Old revision of repository is: " << this->OldRevision + << "\n"); this->PriorRev.Rev = this->OldRevision; return true; } @@ -116,8 +117,9 @@ bool cmCTestHG::NoteOldRevision() bool cmCTestHG::NoteNewRevision() { this->NewRevision = this->GetWorkingRevision(); - cmCTestLog(this->CTest, HANDLER_OUTPUT, " New revision of repository is: " - << this->NewRevision << "\n"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " New revision of repository is: " << this->NewRevision + << "\n"); return true; } @@ -157,8 +159,9 @@ bool cmCTestHG::UpdateImpl() return this->RunUpdateCommand(&hg_update[0], &out, &err); } -class cmCTestHG::LogParser : public cmCTestVC::OutputLogger, - private cmXMLParser +class cmCTestHG::LogParser + : public cmCTestVC::OutputLogger + , private cmXMLParser { public: LogParser(cmCTestHG* hg, const char* prefix) @@ -168,6 +171,7 @@ public: this->InitializeParser(); } ~LogParser() override { this->CleanupParser(); } + private: cmCTestHG* HG; diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx index 1fff2fa..8863dc8 100644 --- a/Source/CTest/cmCTestHandlerCommand.cxx +++ b/Source/CTest/cmCTestHandlerCommand.cxx @@ -158,13 +158,14 @@ bool cmCTestHandlerCommand::InitialPass(std::vector<std::string> const& args, "BuildDirectory", cmSystemTools::CollapseFullPath(bdir).c_str(), this->Quiet); } else { - cmCTestLog(this->CTest, ERROR_MESSAGE, "CTEST_BINARY_DIRECTORY not set" - << std::endl;); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "CTEST_BINARY_DIRECTORY not set" << std::endl;); } } if (this->Values[ct_SOURCE]) { - cmCTestLog(this->CTest, DEBUG, "Set source directory to: " - << this->Values[ct_SOURCE] << std::endl); + cmCTestLog(this->CTest, DEBUG, + "Set source directory to: " << this->Values[ct_SOURCE] + << std::endl); this->CTest->SetCTestConfiguration( "SourceDirectory", cmSystemTools::CollapseFullPath(this->Values[ct_SOURCE]).c_str(), @@ -186,8 +187,9 @@ bool cmCTestHandlerCommand::InitialPass(std::vector<std::string> const& args, cmCTestLog(this->CTest, DEBUG, "Initialize handler" << std::endl;); cmCTestGenericHandler* handler = this->InitializeHandler(); if (!handler) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot instantiate test handler " - << this->GetName() << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot instantiate test handler " << this->GetName() + << std::endl); if (capureCMakeError) { this->Makefile->AddDefinition(this->Values[ct_CAPTURE_CMAKE_ERROR], "-1"); @@ -226,8 +228,8 @@ bool cmCTestHandlerCommand::InitialPass(std::vector<std::string> const& args, if (capureCMakeError) { this->Makefile->AddDefinition(this->Values[ct_CAPTURE_CMAKE_ERROR], "-1"); - cmCTestLog(this->CTest, ERROR_MESSAGE, this->GetName() - << " " << this->GetError() << "\n"); + cmCTestLog(this->CTest, ERROR_MESSAGE, + this->GetName() << " " << this->GetError() << "\n"); // return success because failure is recorded in CAPTURE_CMAKE_ERROR return true; } @@ -303,8 +305,8 @@ bool cmCTestHandlerCommand::CheckArgumentValue(std::string const& arg) return true; } this->Values[k] = arg.c_str(); - cmCTestLog(this->CTest, DEBUG, "Set " << this->Arguments[k] << " to " - << arg << "\n"); + cmCTestLog(this->CTest, DEBUG, + "Set " << this->Arguments[k] << " to " << arg << "\n"); return true; } return false; diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index e078645..0bffde3 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -21,9 +21,9 @@ #include "cmake.h" #ifdef _WIN32 -#include <fcntl.h> // for _O_BINARY -#include <io.h> // for _setmode -#include <stdio.h> // for std{out,err} and fileno +# include <fcntl.h> // for _O_BINARY +# include <io.h> // for _setmode +# include <stdio.h> // for std{out,err} and fileno #endif cmCTestLaunch::cmCTestLaunch(int argc, const char* const* argv) diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index cb1d947..04d1839 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -37,8 +37,9 @@ static CatToErrorType cmCTestMemCheckBoundsChecker[] = { static void xmlReportError(int line, const char* msg, void* data) { cmCTest* ctest = static_cast<cmCTest*>(data); - cmCTestLog(ctest, ERROR_MESSAGE, "Error parsing XML in stream at line " - << line << ": " << msg << std::endl); + cmCTestLog(ctest, ERROR_MESSAGE, + "Error parsing XML in stream at line " << line << ": " << msg + << std::endl); } // parse the xml file containing the results of last BoundsChecker run @@ -366,10 +367,10 @@ void cmCTestMemCheckHandler::GenerateDartOutput(cmXMLWriter& xml) const int maxTestNameWidth = this->CTest->GetMaxTestNameWidth(); std::string outname = result.Name + " "; outname.resize(maxTestNameWidth + 4, '.'); - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, cc + 1 - << "/" << total << " MemCheck: #" - << result.TestCount << ": " << outname - << " Defects: " << memoryErrors << std::endl, + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + cc + 1 << "/" << total << " MemCheck: #" + << result.TestCount << ": " << outname + << " Defects: " << memoryErrors << std::endl, this->Quiet); } xml.StartElement("Log"); @@ -773,8 +774,9 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput( } } if (cc == this->ResultStrings.size()) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown Purify memory fault: " - << pfW.match(1) << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Unknown Purify memory fault: " << pfW.match(1) + << std::endl); ostr << "*** Unknown Purify memory fault: " << pfW.match(1) << std::endl; } @@ -918,11 +920,12 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput( break; // stop the copy of output if we are full } } - cmCTestOptionalLog( - this->CTest, DEBUG, "End test (elapsed: " - << cmDurationTo<unsigned int>(std::chrono::steady_clock::now() - sttime) - << "s)" << std::endl, - this->Quiet); + cmCTestOptionalLog(this->CTest, DEBUG, + "End test (elapsed: " + << cmDurationTo<unsigned int>( + std::chrono::steady_clock::now() - sttime) + << "s)" << std::endl, + this->Quiet); log = ostr.str(); this->DefectCount += defects; return defects == 0; @@ -963,11 +966,12 @@ bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput( results[err]++; defects++; } - cmCTestOptionalLog( - this->CTest, DEBUG, "End test (elapsed: " - << cmDurationTo<unsigned int>(std::chrono::steady_clock::now() - sttime) - << "s)" << std::endl, - this->Quiet); + cmCTestOptionalLog(this->CTest, DEBUG, + "End test (elapsed: " + << cmDurationTo<unsigned int>( + std::chrono::steady_clock::now() - sttime) + << "s)" << std::endl, + this->Quiet); if (defects) { // only put the output of Bounds Checker if there were // errors or leaks detected diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 14b5caa..dcef8a0 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -124,8 +124,9 @@ bool cmCTestMultiProcessHandler::StartTestProcess(int test) std::chrono::system_clock::time_point stop_time = this->CTest->GetStopTime(); if (stop_time != std::chrono::system_clock::time_point() && stop_time <= std::chrono::system_clock::now()) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "The stop time has been passed. " - "Stopping all tests." + cmCTestLog(this->CTest, ERROR_MESSAGE, + "The stop time has been passed. " + "Stopping all tests." << std::endl); this->StopTimePassed = true; return false; @@ -330,10 +331,10 @@ void cmCTestMultiProcessHandler::StartNextTests() bool testLoadOk = true; if (this->TestLoad > 0) { if (processors <= spareLoad) { - cmCTestLog(this->CTest, DEBUG, "OK to run " - << GetName(test) << ", it requires " << processors - << " procs & system load is: " << systemLoad - << std::endl); + cmCTestLog(this->CTest, DEBUG, + "OK to run " << GetName(test) << ", it requires " + << processors << " procs & system load is: " + << systemLoad << std::endl); allTestsFailedTestLoadCheck = false; } else { testLoadOk = false; @@ -712,8 +713,8 @@ void cmCTestMultiProcessHandler::PrintTestList() if (!p.Labels.empty()) // print the labels { - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Labels:", - this->Quiet); + cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Labels:", this->Quiet); } for (std::string const& label : p.Labels) { cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " " << label, @@ -747,7 +748,8 @@ void cmCTestMultiProcessHandler::PrintTestList() cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, std::endl, this->Quiet); } - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, std::endl + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + std::endl << "Total Tests: " << this->Total << std::endl, this->Quiet); } diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h index 19e1a35..203170e 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.h +++ b/Source/CTest/cmCTestMultiProcessHandler.h @@ -74,6 +74,7 @@ public: cmCTestTestHandler* GetTestHandler() { return this->TestHandler; } void SetQuiet(bool b) { this->Quiet = b; } + protected: // Start the next test or tests as many as are allowed by // ParallelLevel diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx index fdf8932..511dbd2 100644 --- a/Source/CTest/cmCTestP4.cxx +++ b/Source/CTest/cmCTestP4.cxx @@ -372,8 +372,9 @@ bool cmCTestP4::NoteOldRevision() { this->OldRevision = this->GetWorkingRevision(); - cmCTestLog(this->CTest, HANDLER_OUTPUT, " Old revision of repository is: " - << this->OldRevision << "\n"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " Old revision of repository is: " << this->OldRevision + << "\n"); this->PriorRev.Rev = this->OldRevision; return true; } @@ -382,8 +383,9 @@ bool cmCTestP4::NoteNewRevision() { this->NewRevision = this->GetWorkingRevision(); - cmCTestLog(this->CTest, HANDLER_OUTPUT, " New revision of repository is: " - << this->NewRevision << "\n"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " New revision of repository is: " << this->NewRevision + << "\n"); return true; } @@ -398,7 +400,8 @@ bool cmCTestP4::LoadRevisions() // If any revision is unknown it means we couldn't contact the server. // Do not process updates if (this->OldRevision == "<unknown>" || this->NewRevision == "<unknown>") { - cmCTestLog(this->CTest, HANDLER_OUTPUT, " At least one of the revisions " + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " At least one of the revisions " << "is unknown. No repository changes will be reported.\n"); return false; } diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 8d8ebaa..e729eeb 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -41,8 +41,8 @@ cmCTestRunTest::cmCTestRunTest(cmCTestMultiProcessHandler& multiHandler) void cmCTestRunTest::CheckOutput(std::string const& line) { - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->GetIndex() - << ": " << line << std::endl); + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + this->GetIndex() << ": " << line << std::endl); this->ProcessOutput += line; this->ProcessOutput += "\n"; @@ -50,7 +50,8 @@ void cmCTestRunTest::CheckOutput(std::string const& line) if (!this->TestProperties->TimeoutRegularExpressions.empty()) { for (auto& reg : this->TestProperties->TimeoutRegularExpressions) { if (reg.first.find(this->ProcessOutput.c_str())) { - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->GetIndex() + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + this->GetIndex() << ": " << "Test timeout changed to " << std::chrono::duration_cast<std::chrono::seconds>( @@ -380,10 +381,10 @@ void cmCTestRunTest::MemCheckPostProcess() if (!this->TestHandler->MemCheck) { return; } - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index - << ": process test output now: " - << this->TestProperties->Name << " " - << this->TestResult.Name << std::endl, + cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + this->Index << ": process test output now: " + << this->TestProperties->Name << " " + << this->TestResult.Name << std::endl, this->TestHandler->GetQuiet()); cmCTestMemCheckHandler* handler = static_cast<cmCTestMemCheckHandler*>(this->TestHandler); @@ -425,7 +426,8 @@ void cmCTestRunTest::StartFailure(std::string const& output) bool cmCTestRunTest::StartTest(size_t total) { this->TotalNumberOfTests = total; // save for rerun case - cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(2 * getNumWidth(total) + 8) + cmCTestLog(this->CTest, HANDLER_OUTPUT, + std::setw(2 * getNumWidth(total) + 8) << "Start " << std::setw(getNumWidth(this->TestHandler->GetMaxIndex())) << this->TestProperties->Index << ": " @@ -592,20 +594,21 @@ void cmCTestRunTest::ComputeArguments() this->TestResult.FullCommandLine = testCommand; // Print the test command in verbose mode - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + std::endl << this->Index << ": " << (this->TestHandler->MemCheck ? "MemCheck" : "Test") << " command: " << testCommand << std::endl); // Print any test-specific env vars in verbose mode if (!this->TestProperties->Environment.empty()) { - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index - << ": " - << "Environment variables: " << std::endl); + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + this->Index << ": " + << "Environment variables: " << std::endl); } for (std::string const& env : this->TestProperties->Environment) { - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index << ": " << env - << std::endl); + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + this->Index << ": " << env << std::endl); } } @@ -658,10 +661,11 @@ bool cmCTestRunTest::ForkProcess(cmDuration testTimeOut, bool explicitTimeout, if (testTimeOut == cmDuration::zero() && explicitTimeout) { timeout = cmDuration::zero(); } - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index - << ": " - << "Test timeout computed to be: " - << cmDurationTo<unsigned int>(timeout) << "\n", + cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + this->Index << ": " + << "Test timeout computed to be: " + << cmDurationTo<unsigned int>(timeout) + << "\n", this->TestHandler->GetQuiet()); this->TestProcess->SetTimeout(timeout); @@ -687,20 +691,20 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total) // got for run until pass. Trick is when this is called we don't // yet know if we are passing or failing. if (this->NumberOfRunsLeft == 1) { - cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(getNumWidth(total)) - << completed << "/"); - cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(getNumWidth(total)) - << total << " "); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + std::setw(getNumWidth(total)) << completed << "/"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + std::setw(getNumWidth(total)) << total << " "); } // if this is one of several runs of a test just print blank space // to keep things neat else { - cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(getNumWidth(total)) - << " " - << " "); - cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(getNumWidth(total)) - << " " - << " "); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + std::setw(getNumWidth(total)) << " " + << " "); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + std::setw(getNumWidth(total)) << " " + << " "); } if (this->TestHandler->MemCheck) { @@ -746,8 +750,8 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total) << std::endl; cmCTestLog(this->CTest, HANDLER_OUTPUT, outname.c_str()); - cmCTestLog(this->CTest, DEBUG, "Testing " << this->TestProperties->Name - << " ... "); + cmCTestLog(this->CTest, DEBUG, + "Testing " << this->TestProperties->Name << " ... "); } void cmCTestRunTest::FinalizeTest() diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx index 73184fc..58d9b3d 100644 --- a/Source/CTest/cmCTestSVN.cxx +++ b/Source/CTest/cmCTestSVN.cxx @@ -107,9 +107,10 @@ bool cmCTestSVN::NoteOldRevision() svninfo.OldRevision = this->LoadInfo(svninfo); this->Log << "Revision for repository '" << svninfo.LocalPath << "' before update: " << svninfo.OldRevision << "\n"; - cmCTestLog( - this->CTest, HANDLER_OUTPUT, " Old revision of external repository '" - << svninfo.LocalPath << "' is: " << svninfo.OldRevision << "\n"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " Old revision of external repository '" + << svninfo.LocalPath << "' is: " << svninfo.OldRevision + << "\n"); } // Set the global old revision to the one of the root @@ -128,9 +129,10 @@ bool cmCTestSVN::NoteNewRevision() svninfo.NewRevision = this->LoadInfo(svninfo); this->Log << "Revision for repository '" << svninfo.LocalPath << "' after update: " << svninfo.NewRevision << "\n"; - cmCTestLog( - this->CTest, HANDLER_OUTPUT, " New revision of external repository '" - << svninfo.LocalPath << "' is: " << svninfo.NewRevision << "\n"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " New revision of external repository '" + << svninfo.LocalPath << "' is: " << svninfo.NewRevision + << "\n"); // svninfo.Root = ""; // uncomment to test GuessBase this->Log << "Repository '" << svninfo.LocalPath @@ -290,8 +292,9 @@ bool cmCTestSVN::RunSVNCommand(std::vector<char const*> const& parameters, return RunChild(&args[0], out, err); } -class cmCTestSVN::LogParser : public cmCTestVC::OutputLogger, - private cmXMLParser +class cmCTestSVN::LogParser + : public cmCTestVC::OutputLogger + , private cmXMLParser { public: LogParser(cmCTestSVN* svn, const char* prefix, SVNInfo& svninfo) @@ -302,6 +305,7 @@ public: this->InitializeParser(); } ~LogParser() override { this->CleanupParser(); } + private: cmCTestSVN* SVN; cmCTestSVN::SVNInfo& SVNRepo; diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 5fff730..333c899 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -39,9 +39,9 @@ #include "cmake.h" #ifdef _WIN32 -#include <windows.h> +# include <windows.h> #else -#include <unistd.h> +# include <unistd.h> #endif class cmExecutionStatus; @@ -184,8 +184,9 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) argv.push_back("-SR"); argv.push_back(total_script_arg.c_str()); - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Executable for CTest is: " - << cmSystemTools::GetCTestCommand() << "\n"); + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Executable for CTest is: " << cmSystemTools::GetCTestCommand() + << "\n"); // now pass through all the other arguments std::vector<std::string>& initArgs = @@ -210,8 +211,8 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) int pipe = cmSystemTools::WaitForLine(cp, line, std::chrono::seconds(100), out, err); while (pipe != cmsysProcess_Pipe_None) { - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Output: " << line - << "\n"); + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Output: " << line << "\n"); if (pipe == cmsysProcess_Pipe_STDERR) { cmCTestLog(this->CTest, ERROR_MESSAGE, line << "\n"); } else if (pipe == cmsysProcess_Pipe_STDOUT) { @@ -230,17 +231,19 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) retVal = cmsysProcess_GetExitValue(cp); } else if (result == cmsysProcess_State_Exception) { retVal = cmsysProcess_GetExitException(cp); - cmCTestLog(this->CTest, ERROR_MESSAGE, "\tThere was an exception: " + cmCTestLog(this->CTest, ERROR_MESSAGE, + "\tThere was an exception: " << cmsysProcess_GetExceptionString(cp) << " " << retVal << std::endl); failed = true; } else if (result == cmsysProcess_State_Expired) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "\tThere was a timeout" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "\tThere was a timeout" << std::endl); failed = true; } else if (result == cmsysProcess_State_Error) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "\tError executing ctest: " - << cmsysProcess_GetErrorString(cp) << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "\tError executing ctest: " << cmsysProcess_GetErrorString(cp) + << std::endl); failed = true; } cmsysProcess_Delete(cp); @@ -253,8 +256,8 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) message << arg << " "; } } - cmCTestLog(this->CTest, ERROR_MESSAGE, message.str() << argv[0] - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + message.str() << argv[0] << std::endl); return -1; } return retVal; @@ -372,8 +375,8 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg) this->Makefile->GetModulesFile("CTestScriptMode.cmake"); if (!this->Makefile->ReadListFile(systemFile.c_str()) || cmSystemTools::GetErrorOccuredFlag()) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Error in read:" << systemFile - << "\n"); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Error in read:" << systemFile << "\n"); return 2; } diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx index 367616c..3911540 100644 --- a/Source/CTest/cmCTestStartCommand.cxx +++ b/Source/CTest/cmCTestStartCommand.cxx @@ -98,14 +98,16 @@ bool cmCTestStartCommand::InitialPass(std::vector<std::string> const& args, this->Quiet); if (smodel) { - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "Run dashboard with model " + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + "Run dashboard with model " << smodel << std::endl << " Source directory: " << src_dir << std::endl << " Build directory: " << bld_dir << std::endl, this->Quiet); } else { - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "Run dashboard with " - "to-be-determined model" + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + "Run dashboard with " + "to-be-determined model" << std::endl << " Source directory: " << src_dir << std::endl << " Build directory: " << bld_dir << std::endl, diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 3bab81e..cae3d4c 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -28,9 +28,9 @@ #include "cmake.h" #if defined(CTEST_USE_XMLRPC) -#include "cmVersion.h" -#include "cm_sys_stat.h" -#include "cm_xmlrpc.h" +# include "cmVersion.h" +# include "cm_sys_stat.h" +# include "cm_xmlrpc.h" #endif #define SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT 120 @@ -248,14 +248,16 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix, res = ::curl_easy_perform(curl); if (!chunk.empty()) { - cmCTestOptionalLog(this->CTest, DEBUG, "CURL output: [" + cmCTestOptionalLog(this->CTest, DEBUG, + "CURL output: [" << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]" << std::endl, this->Quiet); } if (!chunkDebug.empty()) { cmCTestOptionalLog( - this->CTest, DEBUG, "CURL debug output: [" + this->CTest, DEBUG, + "CURL debug output: [" << cmCTestLogWrite(&*chunkDebug.begin(), chunkDebug.size()) << "]" << std::endl, this->Quiet); @@ -263,8 +265,9 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix, fclose(ftpfile); if (res) { - cmCTestLog(this->CTest, ERROR_MESSAGE, " Error when uploading file: " - << local_file << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + " Error when uploading file: " << local_file + << std::endl); cmCTestLog(this->CTest, ERROR_MESSAGE, " Error message was: " << error_buffer << std::endl); *this->LogFile << " Error when uploading file: " << local_file @@ -274,7 +277,8 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix, // avoid dereference of empty vector if (!chunk.empty()) { *this->LogFile << cmCTestLogWrite(&*chunk.begin(), chunk.size()); - cmCTestLog(this->CTest, ERROR_MESSAGE, "CURL output: [" + cmCTestLog(this->CTest, ERROR_MESSAGE, + "CURL output: [" << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]" << std::endl); } @@ -418,8 +422,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, } } std::string upload_as = url + - ((url.find('?') == std::string::npos) ? '?' : '&') + "FileName=" + - ofile; + ((url.find('?') == std::string::npos) ? '?' : '&') + + "FileName=" + ofile; upload_as += "&MD5="; @@ -475,7 +479,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, res = ::curl_easy_perform(curl); if (!chunk.empty()) { - cmCTestOptionalLog(this->CTest, DEBUG, "CURL output: [" + cmCTestOptionalLog(this->CTest, DEBUG, + "CURL output: [" << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]" << std::endl, this->Quiet); @@ -483,7 +488,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, } if (!chunkDebug.empty()) { cmCTestOptionalLog( - this->CTest, DEBUG, "CURL debug output: [" + this->CTest, DEBUG, + "CURL debug output: [" << cmCTestLogWrite(&*chunkDebug.begin(), chunkDebug.size()) << "]" << std::endl, this->Quiet); @@ -537,7 +543,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, if (!chunk.empty()) { cmCTestOptionalLog( - this->CTest, DEBUG, "CURL output: [" + this->CTest, DEBUG, + "CURL output: [" << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]" << std::endl, this->Quiet); @@ -552,8 +559,9 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, fclose(ftpfile); if (res) { - cmCTestLog(this->CTest, ERROR_MESSAGE, " Error when uploading file: " - << local_file << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + " Error when uploading file: " << local_file + << std::endl); cmCTestLog(this->CTest, ERROR_MESSAGE, " Error message was: " << error_buffer << std::endl); *this->LogFile << " Error when uploading file: " << local_file @@ -565,7 +573,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, *this->LogFile << " Curl output was: " << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << std::endl; - cmCTestLog(this->CTest, ERROR_MESSAGE, "CURL output: [" + cmCTestLog(this->CTest, ERROR_MESSAGE, + "CURL output: [" << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]" << std::endl); } @@ -612,7 +621,8 @@ void cmCTestSubmitHandler::ParseResponse( } if (this->HasWarnings || this->HasErrors) { - cmCTestLog(this->CTest, HANDLER_OUTPUT, " Server Response:\n" + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " Server Response:\n" << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "\n"); } } @@ -689,8 +699,8 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(const std::set<std::string>& files, } } std::string turl = url + - ((url.find('?') == std::string::npos) ? '?' : '&') + "xmlfile=" + - ofile; + ((url.find('?') == std::string::npos) ? '?' : '&') + + "xmlfile=" + ofile; *this->LogFile << "Trigger url: " << turl << std::endl; cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Trigger url: " << turl << std::endl, this->Quiet); @@ -709,7 +719,8 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(const std::set<std::string>& files, *this->LogFile << " Curl output was: " << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << std::endl; - cmCTestLog(this->CTest, ERROR_MESSAGE, "CURL output: [" + cmCTestLog(this->CTest, ERROR_MESSAGE, + "CURL output: [" << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]" << std::endl); } @@ -719,14 +730,16 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(const std::set<std::string>& files, } if (!chunk.empty()) { - cmCTestOptionalLog(this->CTest, DEBUG, "CURL output: [" + cmCTestOptionalLog(this->CTest, DEBUG, + "CURL output: [" << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]" << std::endl, this->Quiet); } if (!chunkDebug.empty()) { cmCTestOptionalLog( - this->CTest, DEBUG, "CURL debug output: [" + this->CTest, DEBUG, + "CURL debug output: [" << cmCTestLogWrite(&*chunkDebug.begin(), chunkDebug.size()) << "]" << std::endl, this->Quiet); @@ -777,9 +790,9 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(const std::string& scp_command, argv[1] = lfname.c_str(); std::string rfname = url + "/" + remoteprefix + file; argv[2] = rfname.c_str(); - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Execute \"" - << argv[0] << "\" \"" << argv[1] << "\" \"" << argv[2] - << "\"" << std::endl, + cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Execute \"" << argv[0] << "\" \"" << argv[1] << "\" \"" + << argv[2] << "\"" << std::endl, this->Quiet); *this->LogFile << "Execute \"" << argv[0] << "\" \"" << argv[1] << "\" \"" << argv[2] << "\"" << std::endl; @@ -824,13 +837,14 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(const std::string& scp_command, *this->LogFile << "\tThere was an exception: " << retVal << std::endl; problems++; } else if (result == cmsysProcess_State_Expired) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "\tThere was a timeout" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "\tThere was a timeout" << std::endl); *this->LogFile << "\tThere was a timeout" << std::endl; problems++; } else if (result == cmsysProcess_State_Error) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "\tError executing SCP: " - << cmsysProcess_GetErrorString(cp) << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "\tError executing SCP: " << cmsysProcess_GetErrorString(cp) + << std::endl); *this->LogFile << "\tError executing SCP: " << cmsysProcess_GetErrorString(cp) << std::endl; problems++; @@ -864,8 +878,9 @@ bool cmCTestSubmitHandler::SubmitUsingCP(const std::string& localprefix, lfname += "/" + file; std::string rfname = destination + "/" + remoteprefix + file; cmSystemTools::CopyFileAlways(lfname, rfname); - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Copy file: " - << lfname << " to " << rfname << std::endl, + cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + " Copy file: " << lfname << " to " << rfname + << std::endl, this->Quiet); } std::string tagDoneFile = destination + "/" + remoteprefix + "DONE"; @@ -892,8 +907,9 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC( xmlrpc_env_init(&env); /* Call the famous server at UserLand. */ - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " Submitting to: " - << realURL << " (" << remoteprefix << ")" << std::endl, + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + " Submitting to: " << realURL << " (" << remoteprefix + << ")" << std::endl, this->Quiet); for (std::string const& file : files) { xmlrpc_value* result; @@ -916,8 +932,8 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC( // make sure the file is not too big. if (static_cast<off_t>(static_cast<size_t>(st.st_size)) != static_cast<off_t>(st.st_size)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, " File too big: " << local_file - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + " File too big: " << local_file << std::endl); return false; } size_t fileSize = static_cast<size_t>(st.st_size); @@ -947,9 +963,10 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC( delete[] fileBuffer; if (env.fault_occurred) { - cmCTestLog(this->CTest, ERROR_MESSAGE, " Submission problem: " - << env.fault_string << " (" << env.fault_code << ")" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + " Submission problem: " << env.fault_string << " (" + << env.fault_code << ")" + << std::endl); xmlrpc_env_clean(&env); xmlrpc_client_cleanup(); return false; @@ -1004,8 +1021,8 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, return -1; } if (!cmSystemTools::FileExists(file)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Upload file not found: '" - << file << "'\n"); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Upload file not found: '" << file << "'\n"); return -1; } cmCTestCurl curl(this->CTest); @@ -1040,8 +1057,9 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, unsigned long retryDelayValue = 0; if (!cmSystemTools::StringToULong(retryDelayString.c_str(), &retryDelayValue)) { - cmCTestLog(this->CTest, WARNING, "Invalid value for 'RETRY_DELAY' : " - << retryDelayString << std::endl); + cmCTestLog(this->CTest, WARNING, + "Invalid value for 'RETRY_DELAY' : " << retryDelayString + << std::endl); } else { retryDelay = std::chrono::seconds(retryDelayValue); } @@ -1049,8 +1067,9 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, unsigned long retryCount = 0; if (!retryCountString.empty()) { if (!cmSystemTools::StringToULong(retryCountString.c_str(), &retryCount)) { - cmCTestLog(this->CTest, WARNING, "Invalid value for 'RETRY_DELAY' : " - << retryCountString << std::endl); + cmCTestLog(this->CTest, WARNING, + "Invalid value for 'RETRY_DELAY' : " << retryCountString + << std::endl); } } @@ -1118,7 +1137,8 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, } } if (!internalTest && !requestSucceeded) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Error in HttpRequest\n" + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Error in HttpRequest\n" << response); return -1; } @@ -1128,7 +1148,8 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, Json::Value json; Json::Reader reader; if (!internalTest && !reader.parse(response, json)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "error parsing json string [" + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error parsing json string [" << response << "]\n" << reader.getFormattedErrorMessages() << "\n"); return -1; @@ -1195,12 +1216,14 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, } if (!uploadSucceeded) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "error uploading to CDash. " - << file << " " << url << " " << fstr.str()); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error uploading to CDash. " << file << " " << url << " " + << fstr.str()); return -1; } if (!reader.parse(response, json)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "error parsing json string [" + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error parsing json string [" << response << "]\n" << reader.getFormattedErrorMessages() << "\n"); return -1; @@ -1357,7 +1380,8 @@ int cmCTestSubmitHandler::ProcessHandler() cnt++; } } - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "Submit files (using " + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + "Submit files (using " << this->CTest->GetCTestConfiguration("DropMethod") << ")" << std::endl, this->Quiet); @@ -1380,8 +1404,9 @@ int cmCTestSubmitHandler::ProcessHandler() std::string url = "ftp://"; url += cmCTest::MakeURLSafe( this->CTest->GetCTestConfiguration("DropSiteUser")) + - ":" + cmCTest::MakeURLSafe( - this->CTest->GetCTestConfiguration("DropSitePassword")) + + ":" + + cmCTest::MakeURLSafe( + this->CTest->GetCTestConfiguration("DropSitePassword")) + "@" + this->CTest->GetCTestConfiguration("DropSite") + cmCTest::MakeURLSafe(this->CTest->GetCTestConfiguration("DropLocation")); if (!this->CTest->GetCTestConfiguration("DropSiteUser").empty()) { @@ -1409,12 +1434,13 @@ int cmCTestSubmitHandler::ProcessHandler() return -1; } if (!this->CDash) { - cmCTestOptionalLog( - this->CTest, HANDLER_OUTPUT, " Using HTTP trigger method" - << std::endl - << " Trigger site: " - << this->CTest->GetCTestConfiguration("TriggerSite") << std::endl, - this->Quiet); + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + " Using HTTP trigger method" + << std::endl + << " Trigger site: " + << this->CTest->GetCTestConfiguration("TriggerSite") + << std::endl, + this->Quiet); if (!this->TriggerUsingHTTP( files, prefix, this->CTest->GetCTestConfiguration("TriggerSite"))) { @@ -1466,12 +1492,13 @@ int cmCTestSubmitHandler::ProcessHandler() return -1; } if (!this->CDash) { - cmCTestOptionalLog( - this->CTest, HANDLER_OUTPUT, " Using HTTP trigger method" - << std::endl - << " Trigger site: " - << this->CTest->GetCTestConfiguration("TriggerSite") << std::endl, - this->Quiet); + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + " Using HTTP trigger method" + << std::endl + << " Trigger site: " + << this->CTest->GetCTestConfiguration("TriggerSite") + << std::endl, + this->Quiet); if (!this->TriggerUsingHTTP( files, prefix, this->CTest->GetCTestConfiguration("TriggerSite"))) { @@ -1482,15 +1509,17 @@ int cmCTestSubmitHandler::ProcessHandler() } } if (this->HasErrors) { - cmCTestLog(this->CTest, HANDLER_OUTPUT, " Errors occurred during " - "submission." + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " Errors occurred during " + "submission." << std::endl); ofs << " Errors occurred during submission. " << std::endl; } else { - cmCTestOptionalLog( - this->CTest, HANDLER_OUTPUT, " Submission successful" - << (this->HasWarnings ? ", with warnings." : "") << std::endl, - this->Quiet); + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + " Submission successful" + << (this->HasWarnings ? ", with warnings." : "") + << std::endl, + this->Quiet); ofs << " Submission successful" << (this->HasWarnings ? ", with warnings." : "") << std::endl; } @@ -1587,8 +1616,9 @@ int cmCTestSubmitHandler::ProcessHandler() return 0; } - cmCTestLog(this->CTest, ERROR_MESSAGE, " Unknown submission method: \"" - << dropMethod << "\"" << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + " Unknown submission method: \"" << dropMethod << "\"" + << std::endl); return -1; } diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx index daedf62..895ca12 100644 --- a/Source/CTest/cmCTestTestCommand.cxx +++ b/Source/CTest/cmCTestTestCommand.cxx @@ -112,14 +112,16 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler() if (!cmSystemTools::StringToULong(this->Values[ctt_TEST_LOAD], &testLoad)) { testLoad = 0; - cmCTestLog(this->CTest, WARNING, "Invalid value for 'TEST_LOAD' : " + cmCTestLog(this->CTest, WARNING, + "Invalid value for 'TEST_LOAD' : " << this->Values[ctt_TEST_LOAD] << std::endl); } } else if (ctestTestLoad && *ctestTestLoad) { if (!cmSystemTools::StringToULong(ctestTestLoad, &testLoad)) { testLoad = 0; - cmCTestLog(this->CTest, WARNING, "Invalid value for 'CTEST_TEST_LOAD' : " - << ctestTestLoad << std::endl); + cmCTestLog(this->CTest, WARNING, + "Invalid value for 'CTEST_TEST_LOAD' : " << ctestTestLoad + << std::endl); } } else { testLoad = this->CTest->GetTestLoad(); diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index cbaf984..91b92a3 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -259,7 +259,7 @@ public: /** * This is called when the command is first encountered in * the CMakeLists.txt file. - */ + */ bool InitialPass(std::vector<std::string> const& /*unused*/, cmExecutionStatus& /*unused*/) override; @@ -472,11 +472,12 @@ int cmCTestTestHandler::ProcessHandler() this->TestResults.clear(); - cmCTestOptionalLog( - this->CTest, HANDLER_OUTPUT, (this->MemCheck ? "Memory check" : "Test") - << " project " << cmSystemTools::GetCurrentWorkingDirectory() - << std::endl, - this->Quiet); + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + (this->MemCheck ? "Memory check" : "Test") + << " project " + << cmSystemTools::GetCurrentWorkingDirectory() + << std::endl, + this->Quiet); if (!this->PreProcessHandler()) { return -1; } @@ -500,13 +501,14 @@ int cmCTestTestHandler::ProcessHandler() if (total == 0) { if (!this->CTest->GetShowOnly() && !this->CTest->ShouldPrintLabels()) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "No tests were found!!!" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "No tests were found!!!" << std::endl); } } else { if (this->HandlerVerbose && !passed.empty() && (this->UseIncludeRegExpFlag || this->UseExcludeRegExpFlag)) { - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl + cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + std::endl << "The following tests passed:" << std::endl, this->Quiet); for (std::string const& j : passed) { @@ -533,7 +535,8 @@ int cmCTestTestHandler::ProcessHandler() percent = 99; } - cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl + cmCTestLog(this->CTest, HANDLER_OUTPUT, + std::endl << static_cast<int>(percent + .5f) << "% tests passed, " << failed.size() << " tests failed out of " << total << std::endl); @@ -553,7 +556,8 @@ int cmCTestTestHandler::ProcessHandler() if (!disabledTests.empty()) { cmGeneratedFileStream ofs; - cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl + cmCTestLog(this->CTest, HANDLER_OUTPUT, + std::endl << "The following tests did not run:" << std::endl); this->StartLogFile("TestsDisabled", ofs); @@ -565,15 +569,16 @@ int cmCTestTestHandler::ProcessHandler() } else { disabled_reason = "Skipped"; } - cmCTestLog(this->CTest, HANDLER_OUTPUT, "\t" - << std::setw(3) << dt.TestCount << " - " << dt.Name - << " (" << disabled_reason << ")" << std::endl); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + "\t" << std::setw(3) << dt.TestCount << " - " << dt.Name + << " (" << disabled_reason << ")" << std::endl); } } if (!failed.empty()) { cmGeneratedFileStream ofs; - cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl + cmCTestLog(this->CTest, HANDLER_OUTPUT, + std::endl << "The following tests FAILED:" << std::endl); this->StartLogFile("TestsFailed", ofs); @@ -582,9 +587,10 @@ int cmCTestTestHandler::ProcessHandler() !cmHasLiteralPrefix(ft.CompletionStatus, "SKIP_RETURN_CODE=") && ft.CompletionStatus != "Disabled") { ofs << ft.TestCount << ":" << ft.Name << std::endl; - cmCTestLog(this->CTest, HANDLER_OUTPUT, "\t" - << std::setw(3) << ft.TestCount << " - " << ft.Name - << " (" << this->GetTestStatus(ft) << ")" << std::endl); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + "\t" << std::setw(3) << ft.TestCount << " - " << ft.Name + << " (" << this->GetTestStatus(ft) << ")" + << std::endl); } } } @@ -595,7 +601,8 @@ int cmCTestTestHandler::ProcessHandler() if (!this->StartResultingXML( (this->MemCheck ? cmCTest::PartMemCheck : cmCTest::PartTest), (this->MemCheck ? "DynamicAnalysis" : "Test"), xmlfile)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot create " + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot create " << (this->MemCheck ? "memory check" : "testing") << " XML file" << std::endl); this->LogFile = nullptr; @@ -671,8 +678,8 @@ void cmCTestTestHandler::PrintLabelOrSubprojectSummary(bool doSubProject) cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "\nSubproject Time Summary:", this->Quiet); } else { - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "\nLabel Time Summary:", - this->Quiet); + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + "\nLabel Time Summary:", this->Quiet); } for (std::string const& i : labels) { std::string label = i; @@ -687,7 +694,8 @@ void cmCTestTestHandler::PrintLabelOrSubprojectSummary(bool doSubProject) labelCountStr << "s"; } labelCountStr << ")"; - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "\n" + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + "\n" << label << " = " << buf << " " << labelCountStr.str(), this->Quiet); @@ -1089,9 +1097,10 @@ void cmCTestTestHandler::UpdateForFixtures(ListOfTests& tests) const } } - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Added " - << fixtureTestsAdded - << " tests to meet fixture requirements" << std::endl, + cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Added " << fixtureTestsAdded + << " tests to meet fixture requirements" + << std::endl, this->Quiet); } @@ -1119,8 +1128,9 @@ bool cmCTestTestHandler::GetValue(const char* tag, int& value, fin >> value; ret = cmSystemTools::GetLineFromStream(fin, line); // read blank line } else { - cmCTestLog(this->CTest, ERROR_MESSAGE, "parse error: missing tag: " - << tag << " found [" << line << "]" << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "parse error: missing tag: " << tag << " found [" << line << "]" + << std::endl); ret = false; } return ret; @@ -1136,8 +1146,9 @@ bool cmCTestTestHandler::GetValue(const char* tag, double& value, fin >> value; ret = cmSystemTools::GetLineFromStream(fin, line); // read blank line } else { - cmCTestLog(this->CTest, ERROR_MESSAGE, "parse error: missing tag: " - << tag << " found [" << line << "]" << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "parse error: missing tag: " << tag << " found [" << line << "]" + << std::endl); ret = false; } return ret; @@ -1162,8 +1173,9 @@ bool cmCTestTestHandler::GetValue(const char* tag, bool& value, #endif ret = cmSystemTools::GetLineFromStream(fin, line); // read blank line } else { - cmCTestLog(this->CTest, ERROR_MESSAGE, "parse error: missing tag: " - << tag << " found [" << line << "]" << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "parse error: missing tag: " << tag << " found [" << line << "]" + << std::endl); ret = false; } return ret; @@ -1179,8 +1191,9 @@ bool cmCTestTestHandler::GetValue(const char* tag, size_t& value, fin >> value; ret = cmSystemTools::GetLineFromStream(fin, line); // read blank line } else { - cmCTestLog(this->CTest, ERROR_MESSAGE, "parse error: missing tag: " - << tag << " found [" << line << "]" << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "parse error: missing tag: " << tag << " found [" << line << "]" + << std::endl); ret = false; } return ret; @@ -1195,8 +1208,9 @@ bool cmCTestTestHandler::GetValue(const char* tag, std::string& value, if (line == tag) { ret = cmSystemTools::GetLineFromStream(fin, value); } else { - cmCTestLog(this->CTest, ERROR_MESSAGE, "parse error: missing tag: " - << tag << " found [" << line << "]" << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "parse error: missing tag: " << tag << " found [" << line << "]" + << std::endl); ret = false; } return ret; @@ -1611,7 +1625,8 @@ std::string cmCTestTestHandler::FindExecutable( } } if (fullPath.empty()) { - cmCTestLog(ctest, HANDLER_OUTPUT, "Could not find executable " + cmCTestLog(ctest, HANDLER_OUTPUT, + "Could not find executable " << testCommand << "\n" << "Looked in the following places:\n"); for (std::string const& f : failed) { @@ -1793,8 +1808,8 @@ void cmCTestTestHandler::ExpandTestsToRunInformationForRerunFailed() cmsys::Directory directory; if (directory.Load(dirName) == 0) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Unable to read the contents of " - << dirName << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Unable to read the contents of " << dirName << std::endl); return; } @@ -1829,8 +1844,8 @@ void cmCTestTestHandler::ExpandTestsToRunInformationForRerunFailed() if (!cmSystemTools::FileExists(lastTestsFailedLog)) { if (!this->CTest->GetShowOnly() && !this->CTest->ShouldPrintLabels()) { - cmCTestLog(this->CTest, ERROR_MESSAGE, lastTestsFailedLog - << " does not exist!" << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + lastTestsFailedLog << " does not exist!" << std::endl); } return; } @@ -1852,7 +1867,8 @@ void cmCTestTestHandler::ExpandTestsToRunInformationForRerunFailed() ifs.close(); } else if (!this->CTest->GetShowOnly() && !this->CTest->ShouldPrintLabels()) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Problem reading file: " + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Problem reading file: " << lastTestsFailedLog << " while generating list of previously failed tests." << std::endl); @@ -1961,11 +1977,12 @@ void cmCTestTestHandler::GenerateRegressionImages(cmXMLWriter& xml, xml.Element("Value", "Image " + filename + " is empty"); xml.EndElement(); } else { - cmsys::ifstream ifs(filename.c_str(), std::ios::in + cmsys::ifstream ifs(filename.c_str(), + std::ios::in #ifdef _WIN32 | std::ios::binary #endif - ); + ); unsigned char* file_buffer = new unsigned char[len + 1]; ifs.read(reinterpret_cast<char*>(file_buffer), len); unsigned char* encoded_buffer = new unsigned char[static_cast<int>( @@ -2002,9 +2019,9 @@ void cmCTestTestHandler::GenerateRegressionImages(cmXMLWriter& xml, xml.Attribute("text", "text/string"); xml.Element("Value", "File " + filename + " not found"); xml.EndElement(); - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "File \"" - << filename << "\" not found." << std::endl, - this->Quiet); + cmCTestOptionalLog( + this->CTest, HANDLER_OUTPUT, + "File \"" << filename << "\" not found." << std::endl, this->Quiet); } cxml.erase(measurementfile.start(), measurementfile.end() - measurementfile.start()); diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index 504b210..57e40ce 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -47,7 +47,8 @@ void cmCTestUpdateHandler::Initialize() int cmCTestUpdateHandler::DetermineType(const char* cmd, const char* type) { - cmCTestOptionalLog(this->CTest, DEBUG, "Determine update type from command: " + cmCTestOptionalLog(this->CTest, DEBUG, + "Determine update type from command: " << cmd << " and type: " << type << std::endl, this->Quiet); if (type && *type) { @@ -130,7 +131,8 @@ int cmCTestUpdateHandler::ProcessHandler() return -1; } - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " Use " + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + " Use " << cmCTestUpdateHandlerUpdateToString(this->UpdateType) << " repository type" << std::endl; , this->Quiet); @@ -171,8 +173,8 @@ int cmCTestUpdateHandler::ProcessHandler() // cmGeneratedFileStream os; if (!this->StartResultingXML(cmCTest::PartUpdate, "Update", os)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open log file" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot open log file" << std::endl); return -1; } std::string start_time = this->CTest->CurrentTime(); @@ -191,7 +193,8 @@ int cmCTestUpdateHandler::ProcessHandler() std::string("ctest-") + cmVersion::GetCMakeVersion()); xml.Element("Site", this->CTest->GetCTestConfiguration("Site")); xml.Element("BuildName", buildname); - xml.Element("BuildStamp", this->CTest->GetCurrentTag() + "-" + + xml.Element("BuildStamp", + this->CTest->GetCurrentTag() + "-" + this->CTest->GetTestModelString()); xml.Element("StartDateTime", start_time); xml.Element("StartTime", start_time_time); @@ -209,9 +212,9 @@ int cmCTestUpdateHandler::ProcessHandler() this->Quiet); } if (int numModified = vc->GetPathCount(cmCTestVC::PathModified)) { - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " Found " - << numModified << " locally modified files\n", - this->Quiet); + cmCTestOptionalLog( + this->CTest, HANDLER_OUTPUT, + " Found " << numModified << " locally modified files\n", this->Quiet); localModifications += numModified; } if (int numConflicting = vc->GetPathCount(cmCTestVC::PathConflicting)) { @@ -241,8 +244,9 @@ int cmCTestUpdateHandler::ProcessHandler() if (!updated) { xml.Content("Update command failed:\n"); xml.Content(vc->GetUpdateCommandLine()); - cmCTestLog(this->CTest, HANDLER_OUTPUT, " Update command failed: " - << vc->GetUpdateCommandLine() << "\n"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " Update command failed: " << vc->GetUpdateCommandLine() + << "\n"); } xml.EndElement(); // UpdateReturnStatus xml.EndElement(); // Update diff --git a/Source/CTest/cmCTestUploadHandler.cxx b/Source/CTest/cmCTestUploadHandler.cxx index 59a5de4..261ecab 100644 --- a/Source/CTest/cmCTestUploadHandler.cxx +++ b/Source/CTest/cmCTestUploadHandler.cxx @@ -30,8 +30,8 @@ int cmCTestUploadHandler::ProcessHandler() cmGeneratedFileStream ofs; if (!this->CTest->OpenOutputFile(this->CTest->GetCurrentTag(), "Upload.xml", ofs)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open Upload.xml file" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot open Upload.xml file" << std::endl); return -1; } std::string buildname = @@ -45,7 +45,8 @@ int cmCTestUploadHandler::ProcessHandler() "<file:///Dart/Source/Server/XSL/Build.xsl> \""); xml.StartElement("Site"); xml.Attribute("BuildName", buildname); - xml.Attribute("BuildStamp", this->CTest->GetCurrentTag() + "-" + + xml.Attribute("BuildStamp", + this->CTest->GetCurrentTag() + "-" + this->CTest->GetTestModelString()); xml.Attribute("Name", this->CTest->GetCTestConfiguration("Site")); xml.Attribute("Generator", diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx index 13fa6e1..a59d671 100644 --- a/Source/CTest/cmCTestVC.cxx +++ b/Source/CTest/cmCTestVC.cxx @@ -69,8 +69,8 @@ bool cmCTestVC::InitialCheckout(const char* command) bool result = this->RunChild(&vc_co[0], &out, &err, parent.c_str()); this->Log << "--- End Initial Checkout ---\n"; if (!result) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Initial checkout failed!" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Initial checkout failed!" << std::endl); } return result; } diff --git a/Source/CTest/cmParseCacheCoverage.cxx b/Source/CTest/cmParseCacheCoverage.cxx index 4cd6588..ca1fe70 100644 --- a/Source/CTest/cmParseCacheCoverage.cxx +++ b/Source/CTest/cmParseCacheCoverage.cxx @@ -100,10 +100,11 @@ bool cmParseCacheCoverage::ReadCMCovFile(const char* file) std::string line; std::vector<std::string> separateLine; if (!cmSystemTools::GetLineFromStream(in, line)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Empty file : " - << file << " referenced in this line of cmcov data:\n" - "[" - << line << "]\n"); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Empty file : " << file + << " referenced in this line of cmcov data:\n" + "[" + << line << "]\n"); return false; } separateLine.clear(); @@ -112,8 +113,9 @@ bool cmParseCacheCoverage::ReadCMCovFile(const char* file) separateLine[1] != "Line" || separateLine[2] != "RtnLine" || separateLine[3] != "Code") { cmCTestLog(this->CTest, ERROR_MESSAGE, - "Bad first line of cmcov file : " << file << " line:\n" - "[" + "Bad first line of cmcov file : " << file + << " line:\n" + "[" << line << "]\n"); } std::string routine; @@ -128,8 +130,9 @@ bool cmParseCacheCoverage::ReadCMCovFile(const char* file) if (separateLine.size() < 4) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Bad line of cmcov file expected at least 4 found: " - << separateLine.size() << " " << file << " line:\n" - "[" + << separateLine.size() << " " << file + << " line:\n" + "[" << line << "]\n"); for (std::string::size_type i = 0; i < separateLine.size(); ++i) { cmCTestLog(this->CTest, ERROR_MESSAGE, "" << separateLine[1] << " "); diff --git a/Source/CTest/cmParseDelphiCoverage.cxx b/Source/CTest/cmParseDelphiCoverage.cxx index 6d82cb2..cc81979 100644 --- a/Source/CTest/cmParseDelphiCoverage.cxx +++ b/Source/CTest/cmParseDelphiCoverage.cxx @@ -108,8 +108,9 @@ public: while (true) { lastoffset = line.find('(', pos); if (lastoffset == std::string::npos) { - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, endnamepos - << "File not found " << lastoffset << std::endl, + cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + endnamepos << "File not found " << lastoffset + << std::endl, this->Coverage.Quiet); return false; } diff --git a/Source/CTest/cmParseGTMCoverage.cxx b/Source/CTest/cmParseGTMCoverage.cxx index f965048..822363d 100644 --- a/Source/CTest/cmParseGTMCoverage.cxx +++ b/Source/CTest/cmParseGTMCoverage.cxx @@ -75,7 +75,8 @@ bool cmParseGTMCoverage::ReadMCovFile(const char* file) this->Coverage.TotalCoverage[lastpath][lastoffset + linenumber] += count; } else { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Can not find mumps file : " + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Can not find mumps file : " << lastroutine << " referenced in this line of mcov data:\n" "[" @@ -102,9 +103,11 @@ bool cmParseGTMCoverage::ReadMCovFile(const char* file) lastoffset = lineoffset; } } else { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Can not find mumps file : " - << routine << " referenced in this line of mcov data:\n" - "[" + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Can not find mumps file : " + << routine + << " referenced in this line of mcov data:\n" + "[" << line << "]\n"); } lastfunction = function; @@ -144,8 +147,9 @@ bool cmParseGTMCoverage::FindFunctionInMumpsFile(std::string const& filepath, linenum++; // move to next line count } lineoffset = 0; - cmCTestLog(this->CTest, ERROR_MESSAGE, "Could not find entry point : " - << function << " in " << filepath << "\n"); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Could not find entry point : " << function << " in " << filepath + << "\n"); return false; } @@ -221,8 +225,8 @@ bool cmParseGTMCoverage::ParseMCOVLine(std::string const& line, } // less then two arguments is an error if (args.size() < 2) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Error parsing mcov line: [" - << line << "]\n"); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Error parsing mcov line: [" << line << "]\n"); return false; } routine = args[0]; // the routine is the first argument diff --git a/Source/CTest/cmParseJacocoCoverage.cxx b/Source/CTest/cmParseJacocoCoverage.cxx index 7acb5ca..31e7cd4 100644 --- a/Source/CTest/cmParseJacocoCoverage.cxx +++ b/Source/CTest/cmParseJacocoCoverage.cxx @@ -38,8 +38,9 @@ protected: if (this->PackagePath.empty()) { if (!this->FindPackagePath(fileName)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot find file: " - << this->PackageName << "/" << fileName << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot find file: " << this->PackageName << "/" + << fileName << std::endl); this->Coverage.Error++; return; } diff --git a/Source/CTest/cmParsePHPCoverage.cxx b/Source/CTest/cmParsePHPCoverage.cxx index 761ebec..a6e65c9 100644 --- a/Source/CTest/cmParsePHPCoverage.cxx +++ b/Source/CTest/cmParsePHPCoverage.cxx @@ -153,7 +153,8 @@ bool cmParsePHPCoverage::ReadFileInformation(std::istream& in) delete[] s; // read close quote if (in.get(c) && c != '"') { - cmCTestLog(this->CTest, ERROR_MESSAGE, "failed to read close quote\n" + cmCTestLog(this->CTest, ERROR_MESSAGE, + "failed to read close quote\n" << "read [" << c << "]\n"); return false; } @@ -184,8 +185,8 @@ bool cmParsePHPCoverage::ReadPHPData(const char* file) } for (int i = 0; i < size; i++) { if (!this->ReadFileInformation(in)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Failed to read file #" << i - << "\n"); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Failed to read file #" << i << "\n"); return false; } in.get(c); diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx index 5c9b169..39cea87 100644 --- a/Source/CTest/cmProcess.cxx +++ b/Source/CTest/cmProcess.cxx @@ -13,13 +13,13 @@ #include <signal.h> #include <string> #if !defined(_WIN32) -#include <unistd.h> +# include <unistd.h> #endif #define CM_PROCESS_BUF_SIZE 65536 #if defined(_WIN32) && !defined(__CYGWIN__) -#include <io.h> +# include <io.h> static int cmProcessGetPipes(int* fds) { @@ -40,7 +40,7 @@ static int cmProcessGetPipes(int* fds) return 0; } #else -#include <errno.h> +# include <errno.h> static int cmProcessGetPipes(int* fds) { @@ -167,8 +167,9 @@ bool cmProcess::StartProcess(uv_loop_t& loop, std::vector<size_t>* affinity) status = this->Process.spawn(loop, options, this); if (status != 0) { - cmCTestLog(this->Runner.GetCTest(), ERROR_MESSAGE, "Process not started\n " - << this->Command << "\n[" << uv_strerror(status) << "]\n"); + cmCTestLog(this->Runner.GetCTest(), ERROR_MESSAGE, + "Process not started\n " << this->Command << "\n[" + << uv_strerror(status) << "]\n"); return false; } @@ -345,7 +346,7 @@ void cmProcess::OnExit(int64_t exit_status, int term_signal) #else term_signal != 0 #endif - ) { + ) { this->ProcessState = cmProcess::State::Exception; } else { this->ProcessState = cmProcess::State::Exited; @@ -391,7 +392,7 @@ cmProcess::Exception cmProcess::GetExitException() { auto exception = Exception::None; #if defined(_WIN32) && !defined(__CYGWIN__) - auto exit_code = (DWORD) this->ExitValue; + auto exit_code = (DWORD)this->ExitValue; if ((exit_code & 0xF0000000) != 0xC0000000) { return exception; } @@ -415,12 +416,12 @@ cmProcess::Exception cmProcess::GetExitException() case STATUS_FLOAT_OVERFLOW: case STATUS_FLOAT_STACK_CHECK: case STATUS_FLOAT_UNDERFLOW: -#ifdef STATUS_FLOAT_MULTIPLE_FAULTS +# ifdef STATUS_FLOAT_MULTIPLE_FAULTS case STATUS_FLOAT_MULTIPLE_FAULTS: -#endif -#ifdef STATUS_FLOAT_MULTIPLE_TRAPS +# endif +# ifdef STATUS_FLOAT_MULTIPLE_TRAPS case STATUS_FLOAT_MULTIPLE_TRAPS: -#endif +# endif case STATUS_INTEGER_DIVIDE_BY_ZERO: case STATUS_INTEGER_OVERFLOW: exception = Exception::Numerical; @@ -488,16 +489,16 @@ std::string cmProcess::GetExitExceptionString() case STATUS_FLOAT_UNDERFLOW: exception_str = "Floating-point underflow"; break; -#ifdef STATUS_FLOAT_MULTIPLE_FAULTS +# ifdef STATUS_FLOAT_MULTIPLE_FAULTS case STATUS_FLOAT_MULTIPLE_FAULTS: exception_str = "Floating-point exception (multiple faults)"; break; -#endif -#ifdef STATUS_FLOAT_MULTIPLE_TRAPS +# endif +# ifdef STATUS_FLOAT_MULTIPLE_TRAPS case STATUS_FLOAT_MULTIPLE_TRAPS: exception_str = "Floating-point exception (multiple traps)"; break; -#endif +# endif case STATUS_INTEGER_DIVIDE_BY_ZERO: exception_str = "Integer divide-by-zero"; break; @@ -544,188 +545,188 @@ std::string cmProcess::GetExitExceptionString() } #else switch (this->Signal) { -#ifdef SIGSEGV +# ifdef SIGSEGV case SIGSEGV: exception_str = "Segmentation fault"; break; -#endif -#ifdef SIGBUS -#if !defined(SIGSEGV) || SIGBUS != SIGSEGV +# endif +# ifdef SIGBUS +# if !defined(SIGSEGV) || SIGBUS != SIGSEGV case SIGBUS: exception_str = "Bus error"; break; -#endif -#endif -#ifdef SIGFPE +# endif +# endif +# ifdef SIGFPE case SIGFPE: exception_str = "Floating-point exception"; break; -#endif -#ifdef SIGILL +# endif +# ifdef SIGILL case SIGILL: exception_str = "Illegal instruction"; break; -#endif -#ifdef SIGINT +# endif +# ifdef SIGINT case SIGINT: exception_str = "User interrupt"; break; -#endif -#ifdef SIGABRT +# endif +# ifdef SIGABRT case SIGABRT: exception_str = "Child aborted"; break; -#endif -#ifdef SIGKILL +# endif +# ifdef SIGKILL case SIGKILL: exception_str = "Child killed"; break; -#endif -#ifdef SIGTERM +# endif +# ifdef SIGTERM case SIGTERM: exception_str = "Child terminated"; break; -#endif -#ifdef SIGHUP +# endif +# ifdef SIGHUP case SIGHUP: exception_str = "SIGHUP"; break; -#endif -#ifdef SIGQUIT +# endif +# ifdef SIGQUIT case SIGQUIT: exception_str = "SIGQUIT"; break; -#endif -#ifdef SIGTRAP +# endif +# ifdef SIGTRAP case SIGTRAP: exception_str = "SIGTRAP"; break; -#endif -#ifdef SIGIOT -#if !defined(SIGABRT) || SIGIOT != SIGABRT +# endif +# ifdef SIGIOT +# if !defined(SIGABRT) || SIGIOT != SIGABRT case SIGIOT: exception_str = "SIGIOT"; break; -#endif -#endif -#ifdef SIGUSR1 +# endif +# endif +# ifdef SIGUSR1 case SIGUSR1: exception_str = "SIGUSR1"; break; -#endif -#ifdef SIGUSR2 +# endif +# ifdef SIGUSR2 case SIGUSR2: exception_str = "SIGUSR2"; break; -#endif -#ifdef SIGPIPE +# endif +# ifdef SIGPIPE case SIGPIPE: exception_str = "SIGPIPE"; break; -#endif -#ifdef SIGALRM +# endif +# ifdef SIGALRM case SIGALRM: exception_str = "SIGALRM"; break; -#endif -#ifdef SIGSTKFLT +# endif +# ifdef SIGSTKFLT case SIGSTKFLT: exception_str = "SIGSTKFLT"; break; -#endif -#ifdef SIGCHLD +# endif +# ifdef SIGCHLD case SIGCHLD: exception_str = "SIGCHLD"; break; -#elif defined(SIGCLD) +# elif defined(SIGCLD) case SIGCLD: exception_str = "SIGCLD"; break; -#endif -#ifdef SIGCONT +# endif +# ifdef SIGCONT case SIGCONT: exception_str = "SIGCONT"; break; -#endif -#ifdef SIGSTOP +# endif +# ifdef SIGSTOP case SIGSTOP: exception_str = "SIGSTOP"; break; -#endif -#ifdef SIGTSTP +# endif +# ifdef SIGTSTP case SIGTSTP: exception_str = "SIGTSTP"; break; -#endif -#ifdef SIGTTIN +# endif +# ifdef SIGTTIN case SIGTTIN: exception_str = "SIGTTIN"; break; -#endif -#ifdef SIGTTOU +# endif +# ifdef SIGTTOU case SIGTTOU: exception_str = "SIGTTOU"; break; -#endif -#ifdef SIGURG +# endif +# ifdef SIGURG case SIGURG: exception_str = "SIGURG"; break; -#endif -#ifdef SIGXCPU +# endif +# ifdef SIGXCPU case SIGXCPU: exception_str = "SIGXCPU"; break; -#endif -#ifdef SIGXFSZ +# endif +# ifdef SIGXFSZ case SIGXFSZ: exception_str = "SIGXFSZ"; break; -#endif -#ifdef SIGVTALRM +# endif +# ifdef SIGVTALRM case SIGVTALRM: exception_str = "SIGVTALRM"; break; -#endif -#ifdef SIGPROF +# endif +# ifdef SIGPROF case SIGPROF: exception_str = "SIGPROF"; break; -#endif -#ifdef SIGWINCH +# endif +# ifdef SIGWINCH case SIGWINCH: exception_str = "SIGWINCH"; break; -#endif -#ifdef SIGPOLL +# endif +# ifdef SIGPOLL case SIGPOLL: exception_str = "SIGPOLL"; break; -#endif -#ifdef SIGIO -#if !defined(SIGPOLL) || SIGIO != SIGPOLL +# endif +# ifdef SIGIO +# if !defined(SIGPOLL) || SIGIO != SIGPOLL case SIGIO: exception_str = "SIGIO"; break; -#endif -#endif -#ifdef SIGPWR +# endif +# endif +# ifdef SIGPWR case SIGPWR: exception_str = "SIGPWR"; break; -#endif -#ifdef SIGSYS +# endif +# ifdef SIGSYS case SIGSYS: exception_str = "SIGSYS"; break; -#endif -#ifdef SIGUNUSED -#if !defined(SIGSYS) || SIGUNUSED != SIGSYS +# endif +# ifdef SIGUNUSED +# if !defined(SIGSYS) || SIGUNUSED != SIGSYS case SIGUNUSED: exception_str = "SIGUNUSED"; break; -#endif -#endif +# endif +# endif default: exception_str = "Signal "; exception_str += std::to_string(this->Signal); |