Revise C++ coding style using clang-format-6.0

Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  Use `clang-format` version 6.0.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.
This commit is contained in:
Kitware Robot 2018-06-01 09:53:41 -04:00 committed by Brad King
parent 12fed3edb1
commit d7204e649e
445 changed files with 3734 additions and 3181 deletions

View File

@ -61,7 +61,8 @@ int cmCPackIFWGenerator::PackageFiles()
ifwCmd += " --repository " + rd;
}
} else {
cmCPackIFWLogger(WARNING, "The \"CPACK_IFW_REPOSITORIES_DIRECTORIES\" "
cmCPackIFWLogger(WARNING,
"The \"CPACK_IFW_REPOSITORIES_DIRECTORIES\" "
<< "variable is set, but content will be skipped, "
<< "because this feature available only since "
<< "QtIFW 3.1. Please update your QtIFW instance."
@ -93,7 +94,8 @@ int cmCPackIFWGenerator::PackageFiles()
ofs << "# Run command: " << ifwCmd << std::endl
<< "# Output:" << std::endl
<< output << std::endl;
cmCPackIFWLogger(ERROR, "Problem running IFW command: "
cmCPackIFWLogger(ERROR,
"Problem running IFW command: "
<< ifwCmd << std::endl
<< "Please check " << ifwTmpFile << " for errors"
<< std::endl);
@ -102,15 +104,16 @@ int cmCPackIFWGenerator::PackageFiles()
if (!this->Repository.RepositoryUpdate.empty() &&
!this->Repository.PatchUpdatesXml()) {
cmCPackIFWLogger(WARNING, "Problem patch IFW \"Updates\" "
cmCPackIFWLogger(WARNING,
"Problem patch IFW \"Updates\" "
<< "file: "
<< this->toplevel + "/repository/Updates.xml"
<< std::endl);
}
cmCPackIFWLogger(OUTPUT, "- repository: " << this->toplevel
<< "/repository generated"
<< std::endl);
cmCPackIFWLogger(OUTPUT,
"- repository: " << this->toplevel
<< "/repository generated" << std::endl);
}
// Run binary creator
@ -145,7 +148,8 @@ int cmCPackIFWGenerator::PackageFiles()
ifwCmd += " --repository " + rd;
}
} else {
cmCPackIFWLogger(WARNING, "The \"CPACK_IFW_REPOSITORIES_DIRECTORIES\" "
cmCPackIFWLogger(WARNING,
"The \"CPACK_IFW_REPOSITORIES_DIRECTORIES\" "
<< "variable is set, but content will be skipped, "
<< "because this feature available only since "
<< "QtIFW 3.1. Please update your QtIFW instance."
@ -203,7 +207,8 @@ int cmCPackIFWGenerator::PackageFiles()
ofs << "# Run command: " << ifwCmd << std::endl
<< "# Output:" << std::endl
<< output << std::endl;
cmCPackIFWLogger(ERROR, "Problem running IFW command: "
cmCPackIFWLogger(ERROR,
"Problem running IFW command: "
<< ifwCmd << std::endl
<< "Please check " << ifwTmpFile << " for errors"
<< std::endl);
@ -257,7 +262,8 @@ int cmCPackIFWGenerator::InitializeInternal()
}
if (this->BinCreator.empty()) {
cmCPackIFWLogger(ERROR, "Cannot find QtIFW compiler \"binarycreator\": "
cmCPackIFWLogger(ERROR,
"Cannot find QtIFW compiler \"binarycreator\": "
"likely it is not installed, or not in your PATH"
<< std::endl);
return 0;
@ -415,7 +421,8 @@ cmCPackComponent* cmCPackIFWGenerator::GetComponent(
}
} else {
this->Packages.erase(name);
cmCPackIFWLogger(ERROR, "Cannot configure package \""
cmCPackIFWLogger(ERROR,
"Cannot configure package \""
<< name << "\" for component \"" << component->Name
<< "\"" << std::endl);
}
@ -450,7 +457,8 @@ cmCPackComponentGroup* cmCPackIFWGenerator::GetComponentGroup(
this->BinaryPackages.insert(package);
} else {
this->Packages.erase(name);
cmCPackIFWLogger(ERROR, "Cannot configure package \""
cmCPackIFWLogger(ERROR,
"Cannot configure package \""
<< name << "\" for component group \"" << group->Name
<< "\"" << std::endl);
}
@ -596,7 +604,8 @@ cmCPackIFWRepository* cmCPackIFWGenerator::GetRepository(
} else {
this->Repositories.erase(repositoryName);
repository = nullptr;
cmCPackIFWLogger(WARNING, "Invalid repository \""
cmCPackIFWLogger(WARNING,
"Invalid repository \""
<< repositoryName << "\""
<< " configuration. Repository will be skipped."
<< std::endl);

View File

@ -22,7 +22,9 @@
*
* http://qt-project.org/doc/qtinstallerframework/index.html
*/
class cmCPackIFWGenerator : public cmCPackGenerator, public cmCPackIFWCommon
class cmCPackIFWGenerator
: public cmCPackGenerator
, public cmCPackIFWCommon
{
public:
cmCPackTypeMacro(cmCPackIFWGenerator, cmCPackGenerator);

View File

@ -24,7 +24,8 @@ void cmCPackIFWInstaller::printSkippedOptionWarning(
const std::string& optionName, const std::string& optionValue)
{
cmCPackIFWLogger(
WARNING, "Option "
WARNING,
"Option "
<< optionName << " is set to \"" << optionValue
<< "\" but will be skipped because the specified file does not exist."
<< std::endl);
@ -146,7 +147,8 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
if (this->WizardStyle != "Modern" && this->WizardStyle != "Aero" &&
this->WizardStyle != "Mac" && this->WizardStyle != "Classic") {
cmCPackIFWLogger(
WARNING, "Option CPACK_IFW_PACKAGE_WIZARD_STYLE has unknown value \""
WARNING,
"Option CPACK_IFW_PACKAGE_WIZARD_STYLE has unknown value \""
<< option << "\". Expected values are: Modern, Aero, Mac, Classic."
<< std::endl);
}
@ -469,7 +471,8 @@ void cmCPackIFWInstaller::GenerateInstallerFile()
cmsys::SystemTools::CopyFileIfDifferent(this->Resources[i], path);
resources.push_back(std::move(name));
} else {
cmCPackIFWLogger(WARNING, "Can't copy resources from \""
cmCPackIFWLogger(WARNING,
"Can't copy resources from \""
<< this->Resources[i]
<< "\". Resource will be skipped." << std::endl);
}

View File

@ -226,7 +226,8 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component)
if (const char* option = this->GetOption(prefix + "PRIORITY")) {
this->SortingPriority = option;
cmCPackIFWLogger(
WARNING, "The \"PRIORITY\" option is set "
WARNING,
"The \"PRIORITY\" option is set "
<< "for component \"" << component->Name << "\", but there option is "
<< "deprecated. Please use \"SORTING_PRIORITY\" option instead."
<< std::endl);
@ -303,7 +304,8 @@ int cmCPackIFWPackage::ConfigureFromGroup(cmCPackComponentGroup* group)
if (const char* option = this->GetOption(prefix + "PRIORITY")) {
this->SortingPriority = option;
cmCPackIFWLogger(
WARNING, "The \"PRIORITY\" option is set "
WARNING,
"The \"PRIORITY\" option is set "
<< "for component group \"" << group->Name
<< "\", but there option is "
<< "deprecated. Please use \"SORTING_PRIORITY\" option instead."

View File

@ -55,8 +55,8 @@ bool cmCPackWIXGenerator::RunWiXCommand(std::string const& command)
{
std::string logFileName = this->CPackTopLevel + "/wix.log";
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Running WiX command: " << command
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Running WiX command: " << command << std::endl);
std::string output;
@ -71,7 +71,8 @@ bool cmCPackWIXGenerator::RunWiXCommand(std::string const& command)
logFile.close();
if (!status || returnValue) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running WiX candle. "
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem running WiX candle. "
"Please check '"
<< logFileName << "' for errors." << std::endl);
@ -137,8 +138,8 @@ bool cmCPackWIXGenerator::RunLightCommand(std::string const& objectFiles)
int cmCPackWIXGenerator::PackageFiles()
{
if (!PackageFilesImpl() || cmSystemTools::GetErrorOccuredFlag()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Fatal WiX Generator Error"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Fatal WiX Generator Error" << std::endl);
return false;
}
@ -148,8 +149,8 @@ int cmCPackWIXGenerator::PackageFiles()
bool cmCPackWIXGenerator::InitializeWiXConfiguration()
{
if (!ReadListFile("CPackWIX.cmake")) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Error while executing CPackWIX.cmake"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error while executing CPackWIX.cmake" << std::endl);
return false;
}
@ -166,9 +167,10 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
std::string guid = GenerateGUID();
SetOption("CPACK_WIX_UPGRADE_GUID", guid.c_str());
cmCPackLogger(
cmCPackLog::LOG_WARNING, "CPACK_WIX_UPGRADE_GUID implicitly set to "
<< guid << " . "
cmCPackLogger(cmCPackLog::LOG_WARNING,
"CPACK_WIX_UPGRADE_GUID implicitly set to "
<< guid
<< " . "
"Please refer to the documentation on how and why "
"you might want to set this explicitly."
<< std::endl);
@ -370,7 +372,8 @@ void cmCPackWIXGenerator::CreateWiXPropertiesIncludeFile()
includeFile.AddAttribute("Id", "FindInstallLocation");
includeFile.AddAttribute("Root", "HKLM");
includeFile.AddAttribute(
"Key", "Software\\Microsoft\\Windows\\"
"Key",
"Software\\Microsoft\\Windows\\"
"CurrentVersion\\Uninstall\\[WIX_UPGRADE_DETECTED]");
includeFile.AddAttribute("Name", "InstallLocation");
includeFile.AddAttribute("Type", "raw");
@ -613,8 +616,9 @@ bool cmCPackWIXGenerator::GenerateMainSourceFileFromTemplate()
std::string mainSourceFilePath = this->CPackTopLevel + "/main.wxs";
if (!ConfigureFile(wixTemplate.c_str(), mainSourceFilePath.c_str())) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Failed creating '"
<< mainSourceFilePath << "'' from template." << std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Failed creating '" << mainSourceFilePath
<< "'' from template." << std::endl);
return false;
}
@ -957,8 +961,8 @@ bool cmCPackWIXGenerator::RequireOption(std::string const& name,
return true;
} else {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Required variable "
<< name << " not set" << std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Required variable " << name << " not set" << std::endl);
return false;
}

View File

@ -66,8 +66,9 @@ void cmWIXAccessControlList::CreatePermissionElement(std::string const& entry)
void cmWIXAccessControlList::ReportError(std::string const& entry,
std::string const& message)
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "Failed processing ACL entry '"
<< entry << "': " << message << std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Failed processing ACL entry '" << entry << "': " << message
<< std::endl);
}
bool cmWIXAccessControlList::IsBooleanAttribute(std::string const& name)

View File

@ -13,8 +13,9 @@ bool cmWIXPatch::LoadFragments(std::string const& patchFilePath)
{
cmWIXPatchParser parser(Fragments, Logger);
if (!parser.ParseFile(patchFilePath.c_str())) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Failed parsing XML patch file: '"
<< patchFilePath << "'" << std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Failed parsing XML patch file: '" << patchFilePath << "'"
<< std::endl);
return false;
}

View File

@ -32,7 +32,8 @@ cmWIXSourceWriter::cmWIXSourceWriter(cmCPackLog* logger,
cmWIXSourceWriter::~cmWIXSourceWriter()
{
if (Elements.size() > 1) {
cmCPackLogger(cmCPackLog::LOG_ERROR, Elements.size() - 1
cmCPackLogger(cmCPackLog::LOG_ERROR,
Elements.size() - 1
<< " WiX elements were still open when closing '"
<< SourceFilename << "'" << std::endl);
return;
@ -65,7 +66,8 @@ void cmWIXSourceWriter::EndElement(std::string const& name)
}
if (Elements.back() != name) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "WiX element <"
cmCPackLogger(cmCPackLog::LOG_ERROR,
"WiX element <"
<< Elements.back() << "> can not be closed by </" << name
<< "> in '" << SourceFilename << "'" << std::endl);
return;

View File

@ -87,8 +87,9 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Adding file: " << rp << std::endl);
archive.Add(rp, 0, nullptr, false);
if (!archive) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "ERROR while packaging files: "
<< archive.GetError() << std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"ERROR while packaging files: " << archive.GetError()
<< std::endl);
return 0;
}
}
@ -111,7 +112,8 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(
} \
cmArchiveWrite archive(gf, this->Compress, this->ArchiveFormat); \
if (!(archive)) { \
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem to create archive < " \
cmCPackLogger(cmCPackLog::LOG_ERROR, \
"Problem to create archive < " \
<< (filename) << ">. ERROR =" << (archive).GetError() \
<< std::endl); \
return 0; \
@ -148,7 +150,8 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
// Does the component belong to a group?
if (comp.second.Group == nullptr) {
cmCPackLogger(
cmCPackLog::LOG_VERBOSE, "Component <"
cmCPackLog::LOG_VERBOSE,
"Component <"
<< comp.second.Name
<< "> does not belong to any group, package it separately."
<< std::endl);
@ -258,7 +261,8 @@ int cmCPackArchiveGenerator::PackageFiles()
std::string rp = cmSystemTools::RelativePath(toplevel, file);
archive.Add(rp, 0, nullptr, false);
if (!archive) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem while adding file< "
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem while adding file< "
<< file << "> to archive <" << packageFileNames[0]
<< "> .ERROR =" << archive.GetError() << std::endl);
return 0;

View File

@ -32,8 +32,8 @@ int cmCPackBundleGenerator::InitializeInternal()
"codesign", std::vector<std::string>(), false);
if (codesign_path.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot locate codesign command"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot locate codesign command" << std::endl);
return 0;
}
this->SetOptionIfNotSet("CPACK_COMMAND_CODESIGN", codesign_path.c_str());
@ -59,8 +59,8 @@ int cmCPackBundleGenerator::ConstructBundle()
? this->GetOption("CPACK_BUNDLE_NAME")
: "";
if (cpack_bundle_name.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "CPACK_BUNDLE_NAME must be set."
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_BUNDLE_NAME must be set." << std::endl);
return 0;
}
@ -69,8 +69,8 @@ int cmCPackBundleGenerator::ConstructBundle()
? this->GetOption("CPACK_BUNDLE_PLIST")
: "";
if (cpack_bundle_plist.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "CPACK_BUNDLE_PLIST must be set."
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_BUNDLE_PLIST must be set." << std::endl);
return 0;
}
@ -79,8 +79,8 @@ int cmCPackBundleGenerator::ConstructBundle()
? this->GetOption("CPACK_BUNDLE_ICON")
: "";
if (cpack_bundle_icon.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "CPACK_BUNDLE_ICON must be set."
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_BUNDLE_ICON must be set." << std::endl);
return 0;
}
@ -269,8 +269,8 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir)
return 0;
}
cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Application has been codesigned"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- Application has been codesigned" << std::endl);
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
(this->GetOption("CPACK_BUNDLE_APPLE_ENTITLEMENTS")
? "with entitlement sandboxing"

View File

@ -73,7 +73,8 @@ int cmCPackCygwinSourceGenerator::PackageFiles()
if (!cmSystemTools::CopyFileAlways(
this->GetOption("CPACK_CYGWIN_PATCH_FILE"),
this->GetOption("CPACK_TOPLEVEL_DIRECTORY"))) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "problem copying: ["
cmCPackLogger(cmCPackLog::LOG_ERROR,
"problem copying: ["
<< this->GetOption("CPACK_CYGWIN_PATCH_FILE") << "]\nto\n["
<< this->GetOption("CPACK_TOPLEVEL_DIRECTORY") << "]\n");
return 0;
@ -87,7 +88,8 @@ int cmCPackCygwinSourceGenerator::PackageFiles()
if (!cmSystemTools::CopyFileAlways(
this->GetOption("CPACK_CYGWIN_BUILD_SCRIPT"),
this->GetOption("CPACK_TOPLEVEL_DIRECTORY"))) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "problem copying: "
cmCPackLogger(cmCPackLog::LOG_ERROR,
"problem copying: "
<< this->GetOption("CPACK_CYGWIN_BUILD_SCRIPT") << "\nto\n"
<< this->GetOption("CPACK_TOPLEVEL_DIRECTORY") << "]\n");
return 0;
@ -96,7 +98,8 @@ int cmCPackCygwinSourceGenerator::PackageFiles()
outerTarFile += "-";
const char* patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
if (!patch) {
cmCPackLogger(cmCPackLog::LOG_WARNING, "CPACK_CYGWIN_PATCH_NUMBER"
cmCPackLogger(cmCPackLog::LOG_WARNING,
"CPACK_CYGWIN_PATCH_NUMBER"
<< " not specified, defaulting to 1\n");
patch = "1";
}
@ -147,7 +150,8 @@ const char* cmCPackCygwinSourceGenerator::GetOutputExtension()
this->OutputExtension = "-";
const char* patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
if (!patch) {
cmCPackLogger(cmCPackLog::LOG_WARNING, "CPACK_CYGWIN_PATCH_NUMBER"
cmCPackLogger(cmCPackLog::LOG_WARNING,
"CPACK_CYGWIN_PATCH_NUMBER"
<< " not specified, defaulting to 1\n");
patch = "1";
}

View File

@ -62,8 +62,8 @@ int cmCPackDebGenerator::PackageOnePack(std::string const& initialTopLevel,
this->SetOption("CPACK_DEB_PACKAGE_COMPONENT_PART_PATH",
component_path.c_str());
if (!this->ReadListFile("CPackDeb.cmake")) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Error while execution CPackDeb.cmake"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error while execution CPackDeb.cmake" << std::endl);
retval = 0;
return retval;
}
@ -115,7 +115,8 @@ int cmCPackDebGenerator::PackageComponents(bool ignoreGroup)
// Does the component belong to a group?
if (comp.second.Group == nullptr) {
cmCPackLogger(
cmCPackLog::LOG_VERBOSE, "Component <"
cmCPackLog::LOG_VERBOSE,
"Component <"
<< comp.second.Name
<< "> does not belong to any group, package it separately."
<< std::endl);
@ -179,8 +180,8 @@ int cmCPackDebGenerator::PackageComponentsAllInOne(
component_path.c_str());
}
if (!this->ReadListFile("CPackDeb.cmake")) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Error while execution CPackDeb.cmake"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error while execution CPackDeb.cmake" << std::endl);
retval = 0;
return retval;
}
@ -413,7 +414,8 @@ int cmCPackDebGenerator::createDeb()
cmGeneratedFileStream fileStream_data_tar;
fileStream_data_tar.Open(filename_data_tar.c_str(), false, true);
if (!fileStream_data_tar) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Error opening the file \""
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error opening the file \""
<< filename_data_tar << "\" for writing" << std::endl);
return 0;
}
@ -430,8 +432,8 @@ int cmCPackDebGenerator::createDeb()
// e.g. /opt/bin/foo, /usr/bin/bar and /usr/bin/baz would
// give /usr and /opt
size_t topLevelLength = strGenWDIR.length();
cmCPackLogger(cmCPackLog::LOG_DEBUG, "WDIR: \""
<< strGenWDIR << "\", length = " << topLevelLength
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"WDIR: \"" << strGenWDIR << "\", length = " << topLevelLength
<< std::endl);
std::set<std::string> orderedFiles;
@ -448,13 +450,13 @@ int cmCPackDebGenerator::createDeb()
}
for (std::string const& file : orderedFiles) {
cmCPackLogger(cmCPackLog::LOG_DEBUG, "FILEIT: \"" << file << "\""
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"FILEIT: \"" << file << "\"" << std::endl);
std::string::size_type slashPos = file.find('/', topLevelLength + 1);
std::string relativeDir =
file.substr(topLevelLength, slashPos - topLevelLength);
cmCPackLogger(cmCPackLog::LOG_DEBUG, "RELATIVEDIR: \""
<< relativeDir << "\"" << std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"RELATIVEDIR: \"" << relativeDir << "\"" << std::endl);
#ifdef WIN32
std::string mode_t_adt_filename = file + ":cmake_mode_t";
@ -477,7 +479,8 @@ int cmCPackDebGenerator::createDeb()
// do not recurse because the loop will do it
if (!data_tar.Add(file, topLevelLength, ".", false)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem adding file to tar:"
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem adding file to tar:"
<< std::endl
<< "#top level directory: " << strGenWDIR << std::endl
<< "#file: " << file << std::endl
@ -505,8 +508,8 @@ int cmCPackDebGenerator::createDeb()
std::string output =
cmSystemTools::ComputeFileHash(file, cmCryptoHash::AlgoMD5);
if (output.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem computing the md5 of "
<< file << std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem computing the md5 of " << file << std::endl);
}
output += " " + file + "\n";
@ -527,8 +530,9 @@ int cmCPackDebGenerator::createDeb()
cmGeneratedFileStream fileStream_control_tar;
fileStream_control_tar.Open(filename_control_tar.c_str(), false, true);
if (!fileStream_control_tar) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Error opening the file \""
<< filename_control_tar << "\" for writing"
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error opening the file \"" << filename_control_tar
<< "\" for writing"
<< std::endl);
return 0;
}
@ -557,7 +561,8 @@ int cmCPackDebGenerator::createDeb()
// adds control and md5sums
if (!control_tar.Add(md5filename, strGenWDIR.length(), ".") ||
!control_tar.Add(strGenWDIR + "/control", strGenWDIR.length(), ".")) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Error adding file to tar:"
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error adding file to tar:"
<< std::endl
<< "#top level directory: " << strGenWDIR << std::endl
<< "#file: \"control\" or \"md5sums\"" << std::endl
@ -568,7 +573,8 @@ int cmCPackDebGenerator::createDeb()
// adds generated shlibs file
if (gen_shibs) {
if (!control_tar.Add(shlibsfilename, strGenWDIR.length(), ".")) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Error adding file to tar:"
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error adding file to tar:"
<< std::endl
<< "#top level directory: " << strGenWDIR << std::endl
<< "#file: \"shlibs\"" << std::endl
@ -581,7 +587,8 @@ int cmCPackDebGenerator::createDeb()
if (this->IsOn("GEN_CPACK_DEBIAN_GENERATE_POSTINST")) {
control_tar.SetPermissions(permission755);
if (!control_tar.Add(postinst, strGenWDIR.length(), ".")) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Error adding file to tar:"
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error adding file to tar:"
<< std::endl
<< "#top level directory: " << strGenWDIR << std::endl
<< "#file: \"postinst\"" << std::endl
@ -594,7 +601,8 @@ int cmCPackDebGenerator::createDeb()
if (this->IsOn("GEN_CPACK_DEBIAN_GENERATE_POSTRM")) {
control_tar.SetPermissions(permission755);
if (!control_tar.Add(postrm, strGenWDIR.length(), ".")) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Error adding file to tar:"
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error adding file to tar:"
<< std::endl
<< "#top level directory: " << strGenWDIR << std::endl
<< "#file: \"postinst\"" << std::endl
@ -659,7 +667,8 @@ int cmCPackDebGenerator::createDeb()
if (!deb.Add(tlDir + "debian-binary", tlDir.length()) ||
!deb.Add(tlDir + "control.tar.gz", tlDir.length()) ||
!deb.Add(tlDir + "data.tar" + compression_suffix, tlDir.length())) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Error creating debian package:"
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error creating debian package:"
<< std::endl
<< "#top level directory: " << outputDir << std::endl
<< "#file: " << outputName << std::endl

View File

@ -77,8 +77,8 @@ int cmCPackDragNDropGenerator::InitializeInternal()
const std::string hdiutil_path =
cmSystemTools::FindProgram("hdiutil", std::vector<std::string>(), false);
if (hdiutil_path.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot locate hdiutil command"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot locate hdiutil command" << std::endl);
return 0;
}
this->SetOptionIfNotSet("CPACK_COMMAND_HDIUTIL", hdiutil_path.c_str());
@ -86,16 +86,16 @@ int cmCPackDragNDropGenerator::InitializeInternal()
const std::string setfile_path =
cmSystemTools::FindProgram("SetFile", paths, false);
if (setfile_path.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot locate SetFile command"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot locate SetFile command" << std::endl);
return 0;
}
this->SetOptionIfNotSet("CPACK_COMMAND_SETFILE", setfile_path.c_str());
const std::string rez_path = cmSystemTools::FindProgram("Rez", paths, false);
if (rez_path.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot locate Rez command"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot locate Rez command" << std::endl);
return 0;
}
this->SetOptionIfNotSet("CPACK_COMMAND_REZ", rez_path.c_str());
@ -124,8 +124,8 @@ int cmCPackDragNDropGenerator::InitializeInternal()
return 0;
}
if (!cmSystemTools::FileExists(slaDirectory, false)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "CPACK_DMG_SLA_DIR does not exist"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_DMG_SLA_DIR does not exist" << std::endl);
return 0;
}
@ -140,14 +140,16 @@ int cmCPackDragNDropGenerator::InitializeInternal()
for (auto const& language : languages) {
std::string license = slaDirectory + "/" + language + ".license.txt";
if (!singleLicense && !cmSystemTools::FileExists(license)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Missing license file "
<< language << ".license.txt" << std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Missing license file " << language << ".license.txt"
<< std::endl);
return 0;
}
std::string menu = slaDirectory + "/" + language + ".menu.txt";
if (!cmSystemTools::FileExists(menu)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Missing menu file "
<< language << ".menu.txt" << std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Missing menu file " << language << ".menu.txt"
<< std::endl);
return 0;
}
}
@ -212,8 +214,9 @@ bool cmCPackDragNDropGenerator::CopyFile(std::ostringstream& source,
{
if (!cmSystemTools::CopyFileIfDifferent(source.str().c_str(),
target.str().c_str())) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Error copying "
<< source.str() << " to " << target.str() << std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error copying " << source.str() << " to " << target.str()
<< std::endl);
return false;
}
@ -248,8 +251,8 @@ bool cmCPackDragNDropGenerator::RunCommand(std::ostringstream& command,
this->GeneratorVerbose, cmDuration::zero());
if (!result || exit_code) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Error executing: " << command.str()
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error executing: " << command.str() << std::endl);
return false;
}
@ -400,8 +403,8 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
std::ostringstream dummy_padding;
dummy_padding << staging.str() << "/.dummy-padding-file";
if (!this->CreateEmptyFile(dummy_padding, 1048576)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Error creating dummy padding file."
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error creating dummy padding file." << std::endl);
return 0;
}
@ -460,8 +463,8 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
std::ostringstream dummy_padding;
dummy_padding << temp_mount << "/.dummy-padding-file";
if (!cmSystemTools::RemoveFile(dummy_padding.str())) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Error removing dummy padding file."
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error removing dummy padding file." << std::endl);
had_error = true;
}
@ -565,8 +568,9 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
CFLocaleCreateCanonicalLanguageIdentifierFromString(
nullptr, language_cfstring);
if (!iso_language) {
cmCPackLogger(cmCPackLog::LOG_ERROR, languages[i]
<< " is not a recognized language" << std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
languages[i] << " is not a recognized language"
<< std::endl);
}
char iso_language_cstr[65];
CFStringGetCString(iso_language, iso_language_cstr,
@ -638,9 +642,10 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
ofs.Close();
if (have_write_license_error) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Error writing license file to SLA."
<< std::endl
<< error << std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error writing license file to SLA." << std::endl
<< error
<< std::endl);
return 0;
}
@ -692,9 +697,9 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
embed_sla_command << "\"" << temp_image << "\"";
if (!this->RunCommand(embed_sla_command, &error)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Error adding SLA." << std::endl
<< error
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error adding SLA." << std::endl
<< error << std::endl);
return 0;
}
@ -726,9 +731,10 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
std::string convert_error;
if (!this->RunCommand(final_image_command, &convert_error)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Error compressing disk image."
<< std::endl
<< convert_error << std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error compressing disk image." << std::endl
<< convert_error
<< std::endl);
return 0;
}

View File

@ -61,9 +61,10 @@ int cmCPackGenerator::PrepareNames()
// checks CPACK_SET_DESTDIR support
if (IsOn("CPACK_SET_DESTDIR")) {
if (SETDESTDIR_UNSUPPORTED == SupportsSetDestdir()) {
cmCPackLogger(
cmCPackLog::LOG_ERROR, "CPACK_SET_DESTDIR is set to ON but the '"
<< Name << "' generator does NOT support it." << std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_SET_DESTDIR is set to ON but the '"
<< Name << "' generator does NOT support it."
<< std::endl);
return 0;
}
if (SETDESTDIR_SHOULD_NOT_BE_USED == SupportsSetDestdir()) {
@ -92,8 +93,8 @@ int cmCPackGenerator::PrepareNames()
std::string outName = pfname;
tempDirectory += "/" + outName;
if (!this->GetOutputExtension()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "No output extension specified"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"No output extension specified" << std::endl);
return 0;
}
outName += this->GetOutputExtension();
@ -125,8 +126,8 @@ int cmCPackGenerator::PrepareNames()
"Look for: CPACK_PACKAGE_DESCRIPTION_FILE" << std::endl);
const char* descFileName = this->GetOption("CPACK_PACKAGE_DESCRIPTION_FILE");
if (descFileName) {
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Look for: " << descFileName
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Look for: " << descFileName << std::endl);
if (!cmSystemTools::FileExists(descFileName)) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot find description file name: ["
@ -161,8 +162,9 @@ int cmCPackGenerator::PrepareNames()
const char* algoSignature = this->GetOption("CPACK_PACKAGE_CHECKSUM");
if (algoSignature) {
if (!cmCryptoHash::New(algoSignature)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot recognize algorithm: "
<< algoSignature << std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot recognize algorithm: " << algoSignature
<< std::endl);
return 0;
}
}
@ -215,7 +217,8 @@ int cmCPackGenerator::InstallProject()
cmSystemTools::ExpandListArgument(default_dir_install_permissions, items);
for (const auto& arg : items) {
if (!cmFSPermissions::stringToModeT(arg, default_dir_mode_v)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Invalid permission value '"
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Invalid permission value '"
<< arg
<< "'."
" CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS "
@ -289,10 +292,11 @@ int cmCPackGenerator::InstallProjectViaInstallCommands(
ofs << "# Run command: " << ic << std::endl
<< "# Output:" << std::endl
<< output << std::endl;
cmCPackLogger(
cmCPackLog::LOG_ERROR, "Problem running install command: "
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem running install command: "
<< ic << std::endl
<< "Please check " << tmpFile << " for errors" << std::endl);
<< "Please check " << tmpFile << " for errors"
<< std::endl);
return 0;
}
}
@ -376,8 +380,9 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
}
std::string filePath = tempDir;
filePath += "/" + subdir + "/" + cmSystemTools::RelativePath(top, gf);
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Copy file: "
<< inFile << " -> " << filePath << std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Copy file: " << inFile << " -> " << filePath
<< std::endl);
/* If the file is a symlink we will have to re-create it */
if (cmSystemTools::FileIsSymlink(inFile)) {
std::string targetFile;
@ -392,8 +397,9 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
filePath.c_str()) &&
cmSystemTools::CopyFileTime(inFile.c_str(),
filePath.c_str()))) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying file: "
<< inFile << " -> " << filePath << std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem copying file: " << inFile << " -> "
<< filePath << std::endl);
return 0;
}
}
@ -402,40 +408,44 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
std::string curDir = cmSystemTools::GetCurrentWorkingDirectory();
std::string goToDir = tempDir;
goToDir += "/" + subdir;
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Change dir to: " << goToDir
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Change dir to: " << goToDir << std::endl);
cmWorkingDirectory workdir(goToDir);
if (workdir.Failed()) {
cmCPackLogger(
cmCPackLog::LOG_ERROR, "Failed to change working directory to "
<< goToDir << " : " << std::strerror(workdir.GetLastResult())
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Failed to change working directory to "
<< goToDir << " : "
<< std::strerror(workdir.GetLastResult())
<< std::endl);
return 0;
}
for (auto const& symlinked : symlinkedFiles) {
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Will create a symlink: "
<< symlinked.second << "--> " << symlinked.first
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Will create a symlink: " << symlinked.second << "--> "
<< symlinked.first
<< std::endl);
// make sure directory exists for symlink
std::string destDir =
cmSystemTools::GetFilenamePath(symlinked.second);
if (!destDir.empty() &&
!cmSystemTools::MakeDirectory(destDir, default_dir_mode)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot create dir: "
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot create dir: "
<< destDir << "\nTrying to create symlink: "
<< symlinked.second << "--> " << symlinked.first
<< std::endl);
}
if (!cmSystemTools::CreateSymlink(symlinked.first,
symlinked.second)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot create symlink: "
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot create symlink: "
<< symlinked.second << "--> " << symlinked.first
<< std::endl);
return 0;
}
}
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Going back to: " << curDir
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Going back to: " << curDir << std::endl);
}
}
}
@ -447,8 +457,8 @@ int cmCPackGenerator::InstallProjectViaInstallScript(
{
const char* cmakeScripts = this->GetOption("CPACK_INSTALL_SCRIPT");
if (cmakeScripts && *cmakeScripts) {
cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Install scripts: " << cmakeScripts
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- Install scripts: " << cmakeScripts << std::endl);
std::vector<std::string> cmakeScriptsVector;
cmSystemTools::ExpandListArgument(cmakeScripts, cmakeScriptsVector);
for (std::string const& installScript : cmakeScriptsVector) {
@ -603,8 +613,9 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
preinstall, buildConfig, "", false);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"- Install command: " << buildCommand << std::endl);
cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Run preinstall target for: "
<< installProjectName << std::endl);
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- Run preinstall target for: " << installProjectName
<< std::endl);
std::string output;
int retVal = 1;
bool resB = cmSystemTools::RunSingleCommand(
@ -619,10 +630,11 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
<< "# Directory: " << installDirectory << std::endl
<< "# Output:" << std::endl
<< output << std::endl;
cmCPackLogger(
cmCPackLog::LOG_ERROR, "Problem running install command: "
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem running install command: "
<< buildCommand << std::endl
<< "Please check " << tmpFile << " for errors" << std::endl);
<< "Please check " << tmpFile << " for errors"
<< std::endl);
return 0;
}
}
@ -636,8 +648,9 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
std::string tempInstallDirectory = baseTempInstallDirectory;
installComponent = component;
if (componentInstall) {
cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Install component: "
<< installComponent << std::endl);
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- Install component: " << installComponent
<< std::endl);
}
cmake cm(cmake::RoleScript);
@ -733,8 +746,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
*/
cmSystemTools::PutEnv(std::string("DESTDIR=") +
tempInstallDirectory);
cmCPackLogger(cmCPackLog::LOG_DEBUG, "- Creating directory: '"
<< dir << "'" << std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"- Creating directory: '" << dir << "'" << std::endl);
if (!cmsys::SystemTools::MakeDirectory(dir, default_dir_mode)) {
cmCPackLogger(
@ -840,7 +853,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
localFileName =
localFileName.substr(localFileName.find_first_not_of('/'));
Components[installComponent].Files.push_back(localFileName);
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Adding file <"
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Adding file <"
<< localFileName << "> to component <"
<< installComponent << ">" << std::endl);
}
@ -912,16 +926,16 @@ void cmCPackGenerator::SetOption(const std::string& op, const char* value)
this->MakefileMap->RemoveDefinition(op);
return;
}
cmCPackLogger(cmCPackLog::LOG_DEBUG, this->GetNameOfClass()
<< "::SetOption(" << op << ", " << value << ")"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
this->GetNameOfClass() << "::SetOption(" << op << ", " << value
<< ")" << std::endl);
this->MakefileMap->AddDefinition(op, value);
}
int cmCPackGenerator::DoPackage()
{
cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Create package using " << this->Name
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"Create package using " << this->Name << std::endl);
// Prepare CPack internal name and check
// values for many CPACK_xxx vars
@ -939,8 +953,9 @@ int cmCPackGenerator::DoPackage()
const char* toplevelDirectory =
this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
if (cmSystemTools::FileExists(toplevelDirectory)) {
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Remove toplevel directory: "
<< toplevelDirectory << std::endl);
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Remove toplevel directory: " << toplevelDirectory
<< std::endl);
if (!cmSystemTools::RepeatedRemoveDirectory(toplevelDirectory)) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem removing toplevel directory: "
@ -949,8 +964,8 @@ int cmCPackGenerator::DoPackage()
}
}
}
cmCPackLogger(cmCPackLog::LOG_DEBUG, "About to install project "
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"About to install project " << std::endl);
if (!this->InstallProject()) {
return 0;
@ -975,12 +990,13 @@ int cmCPackGenerator::DoPackage()
}
cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Create package" << std::endl);
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Package files to: "
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Package files to: "
<< (tempPackageFileName ? tempPackageFileName : "(NULL)")
<< std::endl);
if (cmSystemTools::FileExists(tempPackageFileName)) {
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Remove old package file"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Remove old package file" << std::endl);
cmSystemTools::RemoveFile(tempPackageFileName);
}
if (cmSystemTools::IsOn(
@ -1006,8 +1022,8 @@ int cmCPackGenerator::DoPackage()
std::string());
if (!this->PackageFiles() || cmSystemTools::GetErrorOccuredFlag()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem compressing the directory"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem compressing the directory" << std::endl);
return 0;
}
}
@ -1022,8 +1038,9 @@ int cmCPackGenerator::DoPackage()
* - the initially provided name may have changed
* (because the specific generator did 'normalize' it)
*/
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Copying final package(s) ["
<< packageFileNames.size() << "]:" << std::endl);
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Copying final package(s) [" << packageFileNames.size()
<< "]:" << std::endl);
/* now copy package one by one */
for (std::string const& pkgFileName : packageFileNames) {
std::string tmpPF(this->GetOption("CPACK_OUTPUT_FILE_PREFIX"));
@ -1031,20 +1048,23 @@ int cmCPackGenerator::DoPackage()
tempPackageFileName = pkgFileName.c_str();
tmpPF += "/" + filename;
const char* packageFileName = tmpPF.c_str();
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Copy final package(s): "
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Copy final package(s): "
<< (tempPackageFileName ? tempPackageFileName : "(NULL)")
<< " to " << (packageFileName ? packageFileName : "(NULL)")
<< std::endl);
if (!cmSystemTools::CopyFileIfDifferent(tempPackageFileName,
packageFileName)) {
cmCPackLogger(
cmCPackLog::LOG_ERROR, "Problem copying the package: "
cmCPackLog::LOG_ERROR,
"Problem copying the package: "
<< (tempPackageFileName ? tempPackageFileName : "(NULL)") << " to "
<< (packageFileName ? packageFileName : "(NULL)") << std::endl);
return 0;
}
cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- package: "
<< packageFileName << " generated." << std::endl);
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- package: " << packageFileName << " generated."
<< std::endl);
/* Generate checksum file */
if (crypto) {
@ -1053,13 +1073,15 @@ int cmCPackGenerator::DoPackage()
hashFile += "." + cmSystemTools::LowerCase(algo);
cmsys::ofstream outF(hashFile.c_str());
if (!outF) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot create checksum file: "
<< hashFile << std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot create checksum file: " << hashFile
<< std::endl);
return 0;
}
outF << crypto->HashFile(packageFileName) << " " << filename << "\n";
cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- checksum file: "
<< hashFile << " generated." << std::endl);
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- checksum file: " << hashFile << " generated."
<< std::endl);
}
}
@ -1179,7 +1201,8 @@ const char* cmCPackGenerator::GetInstallPath()
const char* cmCPackGenerator::GetPackagingInstallPrefix()
{
cmCPackLogger(cmCPackLog::LOG_DEBUG, "GetPackagingInstallPrefix: '"
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"GetPackagingInstallPrefix: '"
<< this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX") << "'"
<< std::endl);
@ -1188,11 +1211,12 @@ const char* cmCPackGenerator::GetPackagingInstallPrefix()
std::string cmCPackGenerator::FindTemplate(const char* name)
{
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Look for template: "
<< (name ? name : "(NULL)") << std::endl);
std::string ffile = this->MakefileMap->GetModulesFile(name);
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Found template: " << ffile
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Look for template: " << (name ? name : "(NULL)")
<< std::endl);
std::string ffile = this->MakefileMap->GetModulesFile(name);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Found template: " << ffile << std::endl);
return ffile;
}
@ -1260,8 +1284,8 @@ int cmCPackGenerator::PrepareGroupingKind()
}
if (!groupingType.empty()) {
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "["
<< this->Name << "]"
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"[" << this->Name << "]"
<< " requested component grouping = " << groupingType
<< std::endl);
if (groupingType == "ALL_COMPONENTS_IN_ONE") {
@ -1272,8 +1296,8 @@ int cmCPackGenerator::PrepareGroupingKind()
method = ONE_PACKAGE_PER_GROUP;
} else {
cmCPackLogger(
cmCPackLog::LOG_WARNING, "["
<< this->Name << "]"
cmCPackLog::LOG_WARNING,
"[" << this->Name << "]"
<< " requested component grouping type <" << groupingType
<< "> UNKNOWN not in (ALL_COMPONENTS_IN_ONE,IGNORE,ONE_PER_GROUP)"
<< std::endl);
@ -1290,8 +1314,8 @@ int cmCPackGenerator::PrepareGroupingKind()
method = ONE_PACKAGE_PER_COMPONENT;
}
cmCPackLogger(
cmCPackLog::LOG_WARNING, "["
<< this->Name << "]"
cmCPackLog::LOG_WARNING,
"[" << this->Name << "]"
<< " One package per component group requested, "
<< "but NO component groups exist: Ignoring component group."
<< std::endl);
@ -1305,8 +1329,8 @@ int cmCPackGenerator::PrepareGroupingKind()
const char* method_names[] = { "ALL_COMPONENTS_IN_ONE", "IGNORE_GROUPS",
"ONE_PER_GROUP" };
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "["
<< this->Name << "]"
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"[" << this->Name << "]"
<< " requested component grouping = "
<< method_names[componentPackageMethod] << std::endl);
@ -1371,7 +1395,8 @@ bool cmCPackGenerator::SupportsComponentInstallation() const
bool cmCPackGenerator::WantsComponentInstallation() const
{
return (!IsOn("CPACK_MONOLITHIC_INSTALL") && SupportsComponentInstallation()
return (!IsOn("CPACK_MONOLITHIC_INSTALL") &&
SupportsComponentInstallation()
// check that we have at least one group or component
&& (!this->ComponentGroups.empty() || !this->Components.empty()));
}

View File

@ -81,8 +81,8 @@ int cmCPackNSISGenerator::PackageFiles()
str << " Delete \"" << outputDir << "\\" << fileN << "\"" << std::endl;
}
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Uninstall Files: " << str.str()
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Uninstall Files: " << str.str() << std::endl);
this->SetOptionIfNotSet("CPACK_NSIS_DELETE_FILES", str.str().c_str());
std::vector<std::string> dirs;
this->GetListOfSubdirectories(toplevel.c_str(), dirs);
@ -117,12 +117,13 @@ int cmCPackNSISGenerator::PackageFiles()
this->Components[componentName].Directories.push_back(std::move(fileN));
}
}
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Uninstall Dirs: " << dstr.str()
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Uninstall Dirs: " << dstr.str() << std::endl);
this->SetOptionIfNotSet("CPACK_NSIS_DELETE_DIRECTORIES", dstr.str().c_str());
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: "
<< nsisInFileName << " to " << nsisFileName << std::endl);
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Configure file: " << nsisInFileName << " to " << nsisFileName
<< std::endl);
if (this->IsSet("CPACK_NSIS_MUI_ICON") ||
this->IsSet("CPACK_NSIS_MUI_UNIICON")) {
std::string installerIconCode;
@ -308,9 +309,10 @@ int cmCPackNSISGenerator::PackageFiles()
ofs << "# Run command: " << nsisCmd << std::endl
<< "# Output:" << std::endl
<< output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running NSIS command: "
<< nsisCmd << std::endl
<< "Please check " << tmpFile << " for errors"
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem running NSIS command: " << nsisCmd << std::endl
<< "Please check "
<< tmpFile << " for errors"
<< std::endl);
return 0;
}
@ -329,28 +331,31 @@ int cmCPackNSISGenerator::InitializeInternal()
this->SetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", nullptr);
}
cmCPackLogger(cmCPackLog::LOG_DEBUG, "cmCPackNSISGenerator::Initialize()"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"cmCPackNSISGenerator::Initialize()" << std::endl);
std::vector<std::string> path;
std::string nsisPath;
bool gotRegValue = false;
#ifdef _WIN32
if (Nsis64) {
if (!gotRegValue && cmsys::SystemTools::ReadRegistryValue(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS\\Unicode",
nsisPath, cmsys::SystemTools::KeyWOW64_64)) {
if (!gotRegValue &&
cmsys::SystemTools::ReadRegistryValue(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS\\Unicode", nsisPath,
cmsys::SystemTools::KeyWOW64_64)) {
gotRegValue = true;
}
if (!gotRegValue && cmsys::SystemTools::ReadRegistryValue(
if (!gotRegValue &&
cmsys::SystemTools::ReadRegistryValue(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath,
cmsys::SystemTools::KeyWOW64_64)) {
gotRegValue = true;
}
}
if (!gotRegValue && cmsys::SystemTools::ReadRegistryValue(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS\\Unicode",
nsisPath, cmsys::SystemTools::KeyWOW64_32)) {
if (!gotRegValue &&
cmsys::SystemTools::ReadRegistryValue(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS\\Unicode", nsisPath,
cmsys::SystemTools::KeyWOW64_32)) {
gotRegValue = true;
}
if (!gotRegValue &&
@ -358,12 +363,14 @@ int cmCPackNSISGenerator::InitializeInternal()
"HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS\\Unicode", nsisPath)) {
gotRegValue = true;
}
if (!gotRegValue && cmsys::SystemTools::ReadRegistryValue(
if (!gotRegValue &&
cmsys::SystemTools::ReadRegistryValue(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath,
cmsys::SystemTools::KeyWOW64_32)) {
gotRegValue = true;
}
if (!gotRegValue && cmsys::SystemTools::ReadRegistryValue(
if (!gotRegValue &&
cmsys::SystemTools::ReadRegistryValue(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath)) {
gotRegValue = true;
}
@ -395,8 +402,8 @@ int cmCPackNSISGenerator::InitializeInternal()
}
std::string nsisCmd = "\"" + nsisPath + "\" " NSIS_OPT "VERSION";
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Test NSIS version: " << nsisCmd
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Test NSIS version: " << nsisCmd << std::endl);
std::string output;
int retVal = 1;
bool resS = cmSystemTools::RunSingleCommand(
@ -413,17 +420,18 @@ int cmCPackNSISGenerator::InitializeInternal()
ofs << "# Run command: " << nsisCmd << std::endl
<< "# Output:" << std::endl
<< output << std::endl;
cmCPackLogger(
cmCPackLog::LOG_ERROR, "Problem checking NSIS version with command: "
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem checking NSIS version with command: "
<< nsisCmd << std::endl
<< "Please check " << tmpFile << " for errors" << std::endl);
<< "Please check " << tmpFile << " for errors"
<< std::endl);
return 0;
}
if (versionRex.find(output)) {
double nsisVersion = atof(versionRex.match(1).c_str());
double minNSISVersion = 2.09;
cmCPackLogger(cmCPackLog::LOG_DEBUG, "NSIS Version: " << nsisVersion
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"NSIS Version: " << nsisVersion << std::endl);
if (nsisVersion < minNSISVersion) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPack requires NSIS Version 2.09 or greater. "
@ -434,8 +442,8 @@ int cmCPackNSISGenerator::InitializeInternal()
}
if (versionRexCVS.find(output)) {
// No version check for NSIS cvs build
cmCPackLogger(cmCPackLog::LOG_DEBUG, "NSIS Version: CVS "
<< versionRexCVS.match(1) << std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"NSIS Version: CVS " << versionRexCVS.match(1) << std::endl);
}
this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", nsisPath.c_str());
this->SetOptionIfNotSet("CPACK_NSIS_EXECUTABLES_DIRECTORY", "bin");
@ -447,8 +455,9 @@ int cmCPackNSISGenerator::InitializeInternal()
this->GetOption("CPACK_NSIS_EXECUTABLES_DIRECTORY");
std::vector<std::string> cpackPackageDesktopLinksVector;
if (cpackPackageDeskTopLinks) {
cmCPackLogger(cmCPackLog::LOG_DEBUG, "CPACK_CREATE_DESKTOP_LINKS: "
<< cpackPackageDeskTopLinks << std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"CPACK_CREATE_DESKTOP_LINKS: " << cpackPackageDeskTopLinks
<< std::endl);
cmSystemTools::ExpandListArgument(cpackPackageDeskTopLinks,
cpackPackageDesktopLinksVector);
@ -457,7 +466,8 @@ int cmCPackNSISGenerator::InitializeInternal()
"CPACK_CREATE_DESKTOP_LINKS: " << cpdl << std::endl);
}
} else {
cmCPackLogger(cmCPackLog::LOG_DEBUG, "CPACK_CREATE_DESKTOP_LINKS: "
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"CPACK_CREATE_DESKTOP_LINKS: "
<< "not set" << std::endl);
}
@ -465,8 +475,9 @@ int cmCPackNSISGenerator::InitializeInternal()
std::ostringstream deleteStr;
if (cpackPackageExecutables) {
cmCPackLogger(cmCPackLog::LOG_DEBUG, "The cpackPackageExecutables: "
<< cpackPackageExecutables << "." << std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"The cpackPackageExecutables: " << cpackPackageExecutables
<< "." << std::endl);
std::vector<std::string> cpackPackageExecutablesVector;
cmSystemTools::ExpandListArgument(cpackPackageExecutables,
cpackPackageExecutablesVector);
@ -683,8 +694,9 @@ std::string cmCPackNSISGenerator::CreateComponentDescription(
<< std::endl);
if (cmSystemTools::FileExists(archiveFile, true)) {
if (!cmSystemTools::RemoveFile(archiveFile)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Unable to remove archive file "
<< archiveFile << std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Unable to remove archive file " << archiveFile
<< std::endl);
return "";
}
}
@ -694,8 +706,8 @@ std::string cmCPackNSISGenerator::CreateComponentDescription(
this->ReadListFile("CPackZIP.cmake");
if (!this->IsSet("ZIP_EXECUTABLE")) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Unable to find ZIP program"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Unable to find ZIP program" << std::endl);
return "";
}
}
@ -746,9 +758,10 @@ std::string cmCPackNSISGenerator::CreateComponentDescription(
ofs << "# Run command: " << cmd << std::endl
<< "# Output:" << std::endl
<< output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running zip command: "
<< cmd << std::endl
<< "Please check " << tmpFile << " for errors"
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem running zip command: " << cmd << std::endl
<< "Please check "
<< tmpFile << " for errors"
<< std::endl);
return "";
}

View File

@ -92,7 +92,8 @@ void cmCPackNuGetGenerator::SetupGroupComponentVariables(bool ignoreGroup)
// Does the component belong to a group?
if (comp.second.Group == nullptr) {
cmCPackLogger(
cmCPackLog::LOG_VERBOSE, "Component <"
cmCPackLog::LOG_VERBOSE,
"Component <"
<< comp.second.Name
<< "> does not belong to any group, package it separately."
<< std::endl);

View File

@ -27,8 +27,9 @@ int cmCPackOSXX11Generator::PackageFiles()
const char* cpackPackageExecutables =
this->GetOption("CPACK_PACKAGE_EXECUTABLES");
if (cpackPackageExecutables) {
cmCPackLogger(cmCPackLog::LOG_DEBUG, "The cpackPackageExecutables: "
<< cpackPackageExecutables << "." << std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"The cpackPackageExecutables: " << cpackPackageExecutables
<< "." << std::endl);
std::ostringstream str;
std::ostringstream deleteStr;
std::vector<std::string> cpackPackageExecutablesVector;
@ -78,7 +79,8 @@ int cmCPackOSXX11Generator::PackageFiles()
if (iconFile) {
std::string iconFileName = cmsys::SystemTools::GetFilenameName(iconFile);
if (!cmSystemTools::FileExists(iconFile)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find icon file: "
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot find icon file: "
<< iconFile
<< ". Please check CPACK_PACKAGE_ICON setting."
<< std::endl);
@ -109,8 +111,8 @@ int cmCPackOSXX11Generator::PackageFiles()
!this->CopyResourcePlistFile("OSXScriptLauncher", appdir,
this->GetOption("CPACK_PACKAGE_FILE_NAME"),
true)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying the resource files"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem copying the resource files" << std::endl);
return 0;
}
@ -147,8 +149,9 @@ int cmCPackOSXX11Generator::PackageFiles()
dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE")
<< "\" create -ov -fs HFS+ -format UDZO -srcfolder \""
<< diskImageDirectory << "\" \"" << packageFileNames[0] << "\"";
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Compress disk image using command: "
<< dmgCmd.str() << std::endl);
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Compress disk image using command: " << dmgCmd.str()
<< std::endl);
// since we get random dashboard failures with this one
// try running it more than once
int retVal = 1;
@ -170,7 +173,8 @@ int cmCPackOSXX11Generator::PackageFiles()
ofs << "# Run command: " << dmgCmd.str() << std::endl
<< "# Output:" << std::endl
<< output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running hdiutil command: "
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem running hdiutil command: "
<< dmgCmd.str() << std::endl
<< "Please check " << tmpFile << " for errors"
<< std::endl);
@ -182,13 +186,13 @@ int cmCPackOSXX11Generator::PackageFiles()
int cmCPackOSXX11Generator::InitializeInternal()
{
cmCPackLogger(cmCPackLog::LOG_DEBUG, "cmCPackOSXX11Generator::Initialize()"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"cmCPackOSXX11Generator::Initialize()" << std::endl);
std::vector<std::string> path;
std::string pkgPath = cmSystemTools::FindProgram("hdiutil", path, false);
if (pkgPath.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find hdiutil compiler"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot find hdiutil compiler" << std::endl);
return 0;
}
this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM_DISK_IMAGE",
@ -263,8 +267,9 @@ bool cmCPackOSXX11Generator::CopyResourcePlistFile(
destFileName += "/";
destFileName += outputFileName;
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: "
<< inFileName << " to " << destFileName << std::endl);
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Configure file: " << inFileName << " to " << destFileName
<< std::endl);
this->ConfigureFile(inFileName.c_str(), destFileName.c_str(), copyOnly);
return true;
}

View File

@ -26,8 +26,8 @@ bool cmCPackPKGGenerator::SupportsComponentInstallation() const
int cmCPackPKGGenerator::InitializeInternal()
{
cmCPackLogger(cmCPackLog::LOG_DEBUG, "cmCPackPKGGenerator::Initialize()"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"cmCPackPKGGenerator::Initialize()" << std::endl);
return this->Superclass::InitializeInternal();
}
@ -52,8 +52,9 @@ void cmCPackPKGGenerator::WriteDistributionFile(const char* metapackageFile)
std::string distributionTemplate =
this->FindTemplate("CPack.distribution.dist.in");
if (distributionTemplate.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find input file: "
<< distributionTemplate << std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot find input file: " << distributionTemplate
<< std::endl);
return;
}
@ -270,23 +271,26 @@ bool cmCPackPKGGenerator::CopyCreateResourceFile(const std::string& name,
std::string cpackVar = "CPACK_RESOURCE_FILE_" + uname;
const char* inFileName = this->GetOption(cpackVar);
if (!inFileName) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "CPack option: "
<< cpackVar.c_str()
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPack option: " << cpackVar.c_str()
<< " not specified. It should point to "
<< (!name.empty() ? name : "<empty>") << ".rtf, " << name
<< ".html, or " << name << ".txt file" << std::endl);
<< (!name.empty() ? name : "<empty>")
<< ".rtf, " << name << ".html, or " << name
<< ".txt file" << std::endl);
return false;
}
if (!cmSystemTools::FileExists(inFileName)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find "
<< (!name.empty() ? name : "<empty>")
<< " resource file: " << inFileName << std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot find " << (!name.empty() ? name : "<empty>")
<< " resource file: " << inFileName
<< std::endl);
return false;
}
std::string ext = cmSystemTools::GetFilenameLastExtension(inFileName);
if (ext != ".rtfd" && ext != ".rtf" && ext != ".html" && ext != ".txt") {
cmCPackLogger(
cmCPackLog::LOG_ERROR, "Bad file extension specified: "
cmCPackLog::LOG_ERROR,
"Bad file extension specified: "
<< ext
<< ". Currently only .rtfd, .rtf, .html, and .txt files allowed."
<< std::endl);
@ -330,8 +334,9 @@ bool cmCPackPKGGenerator::CopyResourcePlistFile(const std::string& name,
destFileName += "/";
destFileName += outName;
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: "
<< inFileName << " to " << destFileName << std::endl);
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Configure file: " << inFileName << " to " << destFileName
<< std::endl);
this->ConfigureFile(inFileName.c_str(), destFileName.c_str());
return true;
}

View File

@ -251,8 +251,8 @@ int cmCPackPackageMakerGenerator::PackageFiles()
!this->CopyCreateResourceFile("Welcome", resDir) ||
!this->CopyResourcePlistFile("Info.plist") ||
!this->CopyResourcePlistFile("Description.plist")) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying the resource files"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem copying the resource files" << std::endl);
return 0;
}
@ -311,7 +311,8 @@ int cmCPackPackageMakerGenerator::PackageFiles()
ofs << "# Run command: " << dmgCmd.str() << std::endl
<< "# Output:" << std::endl
<< output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running hdiutil command: "
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem running hdiutil command: "
<< dmgCmd.str() << std::endl
<< "Please check " << tmpFile << " for errors"
<< std::endl);
@ -357,8 +358,8 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
} else {
pkgPath = cmSystemTools::FindProgram("PackageMaker", paths, false);
if (pkgPath.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find PackageMaker compiler"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot find PackageMaker compiler" << std::endl);
return 0;
}
this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", pkgPath.c_str());
@ -415,12 +416,13 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
}
this->PackageMakerVersion = atof(rexVersion.match(1).c_str());
if (this->PackageMakerVersion < 1.0) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Require PackageMaker 1.0 or higher"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Require PackageMaker 1.0 or higher" << std::endl);
return 0;
}
cmCPackLogger(cmCPackLog::LOG_DEBUG, "PackageMaker version is: "
<< this->PackageMakerVersion << std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"PackageMaker version is: " << this->PackageMakerVersion
<< std::endl);
// Determine the package compatibility version. If it wasn't
// specified by the user, we define it based on which features the
@ -448,8 +450,8 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
std::vector<std::string> no_paths;
pkgPath = cmSystemTools::FindProgram("hdiutil", no_paths, false);
if (pkgPath.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find hdiutil compiler"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot find hdiutil compiler" << std::endl);
return 0;
}
this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM_DISK_IMAGE",
@ -470,17 +472,18 @@ bool cmCPackPackageMakerGenerator::RunPackageMaker(const char* command,
bool res = cmSystemTools::RunSingleCommand(
command, &output, &output, &retVal, nullptr, this->GeneratorVerbose,
cmDuration::zero());
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Done running package maker"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Done running package maker" << std::endl);
if (!res || retVal) {
cmGeneratedFileStream ofs(tmpFile.c_str());
ofs << "# Run command: " << command << std::endl
<< "# Output:" << std::endl
<< output << std::endl;
cmCPackLogger(
cmCPackLog::LOG_ERROR, "Problem running PackageMaker command: "
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem running PackageMaker command: "
<< command << std::endl
<< "Please check " << tmpFile << " for errors" << std::endl);
<< "Please check " << tmpFile << " for errors"
<< std::endl);
return false;
}
// sometimes the command finishes but the directory is not yet
@ -505,8 +508,9 @@ bool cmCPackPackageMakerGenerator::GenerateComponentPackage(
const char* packageFile, const char* packageDir,
const cmCPackComponent& component)
{
cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Building component package: "
<< packageFile << std::endl);
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- Building component package: " << packageFile
<< std::endl);
// The command that will be used to run PackageMaker
std::ostringstream pkgCmd;

View File

@ -67,8 +67,8 @@ int cmCPackProductBuildGenerator::PackageFiles()
this->GetOption("CPACK_PRODUCTBUILD_RESOURCES_DIR");
if (!cmSystemTools::CopyADirectory(userResDir, resDir)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying the resource files"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem copying the resource files" << std::endl);
return 0;
}
}
@ -121,16 +121,16 @@ int cmCPackProductBuildGenerator::InitializeInternal()
std::string program =
cmSystemTools::FindProgram("pkgbuild", no_paths, false);
if (program.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find pkgbuild executable"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot find pkgbuild executable" << std::endl);
return 0;
}
this->SetOptionIfNotSet("CPACK_COMMAND_PKGBUILD", program.c_str());
program = cmSystemTools::FindProgram("productbuild", no_paths, false);
if (program.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find productbuild executable"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot find productbuild executable" << std::endl);
return 0;
}
this->SetOptionIfNotSet("CPACK_COMMAND_PRODUCTBUILD", program.c_str());
@ -172,8 +172,9 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage(
packageFile += '/';
packageFile += packageFileName;
cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Building component package: "
<< packageFile << std::endl);
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- Building component package: " << packageFile
<< std::endl);
const char* comp_name = component ? component->Name.c_str() : nullptr;

View File

@ -90,8 +90,8 @@ int cmCPackRPMGenerator::PackageOnePack(std::string const& initialToplevel,
this->SetOption("CPACK_RPM_PACKAGE_COMPONENT_PART_PATH",
component_path.c_str());
if (!this->ReadListFile("CPackRPM.cmake")) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Error while execution CPackRPM.cmake"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error while execution CPackRPM.cmake" << std::endl);
retval = 0;
}
@ -165,7 +165,8 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
}
if (shouldSet) {
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Setting "
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Setting "
<< "CPACK_RPM_DEBUGINFO_PACKAGE because "
<< "CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE is set but "
<< " none of the "
@ -203,8 +204,9 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
continue;
}
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Packaging component group: "
<< compGIt->first << std::endl);
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Packaging component group: " << compGIt->first
<< std::endl);
retval &= PackageOnePack(initialTopLevel, compGIt->first);
}
// Handle Orphan components (components not belonging to any groups)
@ -226,7 +228,8 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
}
cmCPackLogger(
cmCPackLog::LOG_VERBOSE, "Component <"
cmCPackLog::LOG_VERBOSE,
"Component <"
<< compIt->second.Name
<< "> does not belong to any group, package it separately."
<< std::endl);
@ -242,7 +245,8 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
} else if (mainCompIt != this->Components.end()) {
retval &= PackageOnePack(initialTopLevel, mainCompIt->first);
} else {
cmCPackLogger(cmCPackLog::LOG_ERROR, "CPACK_RPM_MAIN_COMPONENT set"
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_RPM_MAIN_COMPONENT set"
<< " to non existing component.\n");
retval = 0;
}
@ -276,7 +280,8 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
if (mainCompIt != this->Components.end()) {
retval &= PackageOnePack(initialTopLevel, mainCompIt->first);
} else {
cmCPackLogger(cmCPackLog::LOG_ERROR, "CPACK_RPM_MAIN_COMPONENT set"
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_RPM_MAIN_COMPONENT set"
<< " to non existing component.\n");
retval = 0;
}
@ -290,8 +295,9 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
std::map<std::string, cmCPackComponentGroup>::iterator compGIt;
for (compGIt = this->ComponentGroups.begin();
compGIt != this->ComponentGroups.end(); ++compGIt) {
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Packaging component group: "
<< compGIt->first << std::endl);
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Packaging component group: " << compGIt->first
<< std::endl);
retval &= PackageOnePack(initialTopLevel, compGIt->first);
}
// Handle Orphan components (components not belonging to any groups)
@ -301,7 +307,8 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
// Does the component belong to a group?
if (compIt->second.Group == nullptr) {
cmCPackLogger(
cmCPackLog::LOG_VERBOSE, "Component <"
cmCPackLog::LOG_VERBOSE,
"Component <"
<< compIt->second.Name
<< "> does not belong to any group, package it separately."
<< std::endl);
@ -320,7 +327,8 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
}
} else {
cmCPackLogger(
cmCPackLog::LOG_ERROR, "CPACK_RPM_MAIN_COMPONENT not set but"
cmCPackLog::LOG_ERROR,
"CPACK_RPM_MAIN_COMPONENT not set but"
<< " it is mandatory with CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE"
<< " being set.\n");
retval = 0;
@ -380,8 +388,8 @@ int cmCPackRPMGenerator::PackageComponentsAllInOne(
if (this->ReadListFile("CPackRPM.cmake")) {
AddGeneratedPackageNames();
} else {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Error while execution CPackRPM.cmake"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error while execution CPackRPM.cmake" << std::endl);
retval = 0;
}

View File

@ -100,8 +100,8 @@ int cmCPackSTGZGenerator::GenerateHeader(std::ostream* os)
++ptr;
}
counter++;
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Number of lines: " << counter
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Number of lines: " << counter << std::endl);
char buffer[1024];
sprintf(buffer, "%d", counter);
cmSystemTools::ReplaceString(res, headerLengthTag, buffer);

View File

@ -82,8 +82,9 @@ int cpackDefinitionArgument(const char* argument, const char* cValue,
std::string key = value.substr(0, pos);
value = value.c_str() + pos + 1;
def->Map[key] = value;
cmCPack_Log(def->Log, cmCPackLog::LOG_DEBUG, "Set CPack variable: "
<< key << " to \"" << value << "\"" << std::endl);
cmCPack_Log(def->Log, cmCPackLog::LOG_DEBUG,
"Set CPack variable: " << key << " to \"" << value << "\""
<< std::endl);
return 1;
}
@ -320,8 +321,8 @@ int main(int argc, char const* const* argv)
}
const char* genList = globalMF.GetDefinition("CPACK_GENERATOR");
if (!genList) {
cmCPack_Log(&log, cmCPackLog::LOG_ERROR, "CPack generator not specified"
<< std::endl);
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
"CPack generator not specified" << std::endl);
} else {
std::vector<std::string> generatorsVector;
cmSystemTools::ExpandListArgument(genList, generatorsVector);
@ -384,8 +385,9 @@ int main(int argc, char const* const* argv)
}
if (parsed) {
const char* projName = mf->GetDefinition("CPACK_PACKAGE_NAME");
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE, "Use generator: "
<< cpackGenerator->GetNameOfClass() << std::endl);
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE,
"Use generator: " << cpackGenerator->GetNameOfClass()
<< std::endl);
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE,
"For project: " << projName << std::endl);

View File

@ -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)

View File

@ -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,
@ -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,17 +467,18 @@ 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
cmCTestLog(this->CTest, HANDLER_OUTPUT,
" " << this->TotalErrors
<< (this->TotalErrors >= this->MaxErrors ? " or more" : "")
<< " Compiler errors" << std::endl);
cmCTestLog(this->CTest, HANDLER_OUTPUT, " "
<< this->TotalWarnings
cmCTestLog(
this->CTest, HANDLER_OUTPUT,
" " << this->TotalWarnings
<< (this->TotalWarnings >= this->MaxWarnings ? " or more" : "")
<< " Compiler warnings" << std::endl);
@ -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,

View File

@ -134,7 +134,8 @@ private:
bool ProcessLine() override
{
if (this->Line == ("======================================="
if (this->Line ==
("======================================="
"======================================")) {
// This line ends the revision list.
if (this->Section == SectionRevisions) {

View File

@ -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();

View File

@ -197,9 +197,9 @@ 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;
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,7 +525,8 @@ int cmCTestCoverageHandler::ProcessHandler()
float cper = 0;
float cmet = 0;
if (tested + untested > 0) {
cper = (100 * SAFEDIV(static_cast<float>(tested),
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,8 +631,8 @@ int cmCTestCoverageHandler::ProcessHandler()
covSumXML.EndElement(); // Coverage
this->CTest->EndXML(covSumXML);
cmCTestLog(this->CTest, HANDLER_OUTPUT, ""
<< 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
@ -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,28 +1155,30 @@ 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 "
cmCTestOptionalLog(this->CTest, WARNING,
"Warning: File: " << st2re6.match(1)
<< " is newer than "
<< st2re6.match(2) << std::endl,
this->Quiet);
} else {
@ -1181,8 +1186,9 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
// "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;

View File

@ -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);

View File

@ -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;
}

View File

@ -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());

View File

@ -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;

View File

@ -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;

View File

@ -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,8 +367,8 @@ 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: #"
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
cc + 1 << "/" << total << " MemCheck: #"
<< result.TestCount << ": " << outname
<< " Defects: " << memoryErrors << std::endl,
this->Quiet);
@ -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,9 +920,10 @@ 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)
cmCTestOptionalLog(this->CTest, DEBUG,
"End test (elapsed: "
<< cmDurationTo<unsigned int>(
std::chrono::steady_clock::now() - sttime)
<< "s)" << std::endl,
this->Quiet);
log = ostr.str();
@ -963,9 +966,10 @@ bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput(
results[err]++;
defects++;
}
cmCTestOptionalLog(
this->CTest, DEBUG, "End test (elapsed: "
<< cmDurationTo<unsigned int>(std::chrono::steady_clock::now() - sttime)
cmCTestOptionalLog(this->CTest, DEBUG,
"End test (elapsed: "
<< cmDurationTo<unsigned int>(
std::chrono::steady_clock::now() - sttime)
<< "s)" << std::endl,
this->Quiet);
if (defects) {

View File

@ -124,7 +124,8 @@ 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. "
cmCTestLog(this->CTest, ERROR_MESSAGE,
"The stop time has been passed. "
"Stopping all tests."
<< std::endl);
this->StopTimePassed = true;
@ -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);
}

View File

@ -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

View File

@ -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;
}

View File

@ -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,8 +381,8 @@ void cmCTestRunTest::MemCheckPostProcess()
if (!this->TestHandler->MemCheck) {
return;
}
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index
<< ": process test output now: "
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
this->Index << ": process test output now: "
<< this->TestProperties->Name << " "
<< this->TestResult.Name << std::endl,
this->TestHandler->GetQuiet());
@ -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
<< ": "
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
<< ": "
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
this->Index << ": "
<< "Test timeout computed to be: "
<< cmDurationTo<unsigned int>(timeout) << "\n",
<< cmDurationTo<unsigned int>(timeout)
<< "\n",
this->TestHandler->GetQuiet());
this->TestProcess->SetTimeout(timeout);
@ -687,19 +691,19 @@ 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)) << " "
<< " ");
}
@ -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()

View File

@ -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;

View File

@ -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;
}

View File

@ -98,13 +98,15 @@ 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 "
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
"Run dashboard with "
"to-be-determined model"
<< std::endl
<< " Source directory: " << src_dir << std::endl

View File

@ -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,8 +963,9 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(
delete[] fileBuffer;
if (env.fault_occurred) {
cmCTestLog(this->CTest, ERROR_MESSAGE, " Submission problem: "
<< env.fault_string << " (" << env.fault_code << ")"
cmCTestLog(this->CTest, ERROR_MESSAGE,
" Submission problem: " << env.fault_string << " ("
<< env.fault_code << ")"
<< std::endl);
xmlrpc_env_clean(&env);
xmlrpc_client_cleanup();
@ -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,7 +1404,8 @@ int cmCTestSubmitHandler::ProcessHandler()
std::string url = "ftp://";
url += cmCTest::MakeURLSafe(
this->CTest->GetCTestConfiguration("DropSiteUser")) +
":" + cmCTest::MakeURLSafe(
":" +
cmCTest::MakeURLSafe(
this->CTest->GetCTestConfiguration("DropSitePassword")) +
"@" + this->CTest->GetCTestConfiguration("DropSite") +
cmCTest::MakeURLSafe(this->CTest->GetCTestConfiguration("DropLocation"));
@ -1409,11 +1434,12 @@ int cmCTestSubmitHandler::ProcessHandler()
return -1;
}
if (!this->CDash) {
cmCTestOptionalLog(
this->CTest, HANDLER_OUTPUT, " Using HTTP trigger method"
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
" Using HTTP trigger method"
<< std::endl
<< " Trigger site: "
<< this->CTest->GetCTestConfiguration("TriggerSite") << std::endl,
<< this->CTest->GetCTestConfiguration("TriggerSite")
<< std::endl,
this->Quiet);
if (!this->TriggerUsingHTTP(
files, prefix,
@ -1466,11 +1492,12 @@ int cmCTestSubmitHandler::ProcessHandler()
return -1;
}
if (!this->CDash) {
cmCTestOptionalLog(
this->CTest, HANDLER_OUTPUT, " Using HTTP trigger method"
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
" Using HTTP trigger method"
<< std::endl
<< " Trigger site: "
<< this->CTest->GetCTestConfiguration("TriggerSite") << std::endl,
<< this->CTest->GetCTestConfiguration("TriggerSite")
<< std::endl,
this->Quiet);
if (!this->TriggerUsingHTTP(
files, prefix,
@ -1482,14 +1509,16 @@ int cmCTestSubmitHandler::ProcessHandler()
}
}
if (this->HasErrors) {
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Errors occurred during "
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,
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;
}

View File

@ -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();

View File

@ -472,9 +472,10 @@ int cmCTestTestHandler::ProcessHandler()
this->TestResults.clear();
cmCTestOptionalLog(
this->CTest, HANDLER_OUTPUT, (this->MemCheck ? "Memory check" : "Test")
<< " project " << cmSystemTools::GetCurrentWorkingDirectory()
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
(this->MemCheck ? "Memory check" : "Test")
<< " project "
<< cmSystemTools::GetCurrentWorkingDirectory()
<< std::endl,
this->Quiet);
if (!this->PreProcessHandler()) {
@ -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
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,7 +1977,8 @@ 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
@ -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());

View File

@ -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

View File

@ -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",

View File

@ -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;
}

View File

@ -100,8 +100,9 @@ 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"
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Empty file : " << file
<< " referenced in this line of cmcov data:\n"
"["
<< line << "]\n");
return false;
@ -112,7 +113,8 @@ 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");
}
@ -128,7 +130,8 @@ 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) {

View File

@ -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;
}

View File

@ -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,8 +103,10 @@ 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");
}
@ -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

View File

@ -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;
}

View File

@ -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);

View File

@ -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;
}

View File

@ -22,9 +22,11 @@ static const char* cmDocumentationName[][2] = {
};
static const char* cmDocumentationUsage[][2] = {
{ nullptr, " ccmake <path-to-source>\n"
{ nullptr,
" ccmake <path-to-source>\n"
" ccmake <path-to-existing-build>" },
{ nullptr, "Specify a source directory to (re-)generate a build system for "
{ nullptr,
"Specify a source directory to (re-)generate a build system for "
"it in the current working directory. Specify an existing build "
"directory to re-generate its build system." },
{ nullptr, nullptr }
@ -35,9 +37,10 @@ static const char* cmDocumentationUsageNote[][2] = {
{ nullptr, nullptr }
};
static const char* cmDocumentationOptions[]
[2] = { CMAKE_STANDARD_OPTIONS_TABLE,
{ nullptr, nullptr } };
static const char* cmDocumentationOptions[][2] = {
CMAKE_STANDARD_OPTIONS_TABLE,
{ nullptr, nullptr }
};
cmCursesForm* cmCursesForm::CurrentForm = nullptr;

View File

@ -371,7 +371,8 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */)
sprintf(thirdLine, toggleKeyInstruction,
this->AdvancedMode ? "On" : "Off");
}
sprintf(secondLine, "Press [h] for help "
sprintf(secondLine,
"Press [h] for help "
"Press [q] to quit without generating");
}
@ -412,7 +413,8 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
curses_clear();
curses_move(0, 0);
char fmt[] = "Window is too small. A size of at least %dx%d is required.";
printw(fmt, (cmCursesMainForm::MIN_WIDTH < this->InitialWidth
printw(fmt,
(cmCursesMainForm::MIN_WIDTH < this->InitialWidth
? this->InitialWidth
: cmCursesMainForm::MIN_WIDTH),
cmCursesMainForm::MIN_HEIGHT);
@ -568,8 +570,9 @@ int cmCursesMainForm::Configure(int noconfigure)
}
int xx, yy;
getmaxyx(stdscr, yy, xx);
cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm(
this->Errors, cmSystemTools::GetErrorOccuredFlag()
cmCursesLongMessageForm* msgs =
new cmCursesLongMessageForm(this->Errors,
cmSystemTools::GetErrorOccuredFlag()
? "Errors occurred during the last pass."
: "CMake produced the following output.");
// reset error condition

View File

@ -11,7 +11,9 @@
#include "ui_AddCacheEntry.h"
class AddCacheEntry : public QWidget, public Ui::AddCacheEntry
class AddCacheEntry
: public QWidget
, public Ui::AddCacheEntry
{
Q_OBJECT
public:

View File

@ -27,7 +27,8 @@ static const char* cmDocumentationName[][2] = { { nullptr,
{ nullptr, nullptr } };
static const char* cmDocumentationUsage[][2] = {
{ nullptr, " cmake-gui [options]\n"
{ nullptr,
" cmake-gui [options]\n"
" cmake-gui [options] <path-to-source>\n"
" cmake-gui [options] <path-to-existing-build>" },
{ nullptr, nullptr }

View File

@ -989,7 +989,8 @@ void CMakeSetupDialog::removeSelectedCacheEntries()
void CMakeSetupDialog::selectionChanged()
{
QModelIndexList idxs = this->CacheValues->selectionModel()->selectedRows();
if (idxs.count() && (this->CurrentState == ReadyConfigure ||
if (idxs.count() &&
(this->CurrentState == ReadyConfigure ||
this->CurrentState == ReadyGenerate)) {
this->RemoveEntry->setEnabled(true);
} else {

View File

@ -16,7 +16,9 @@ class QProgressBar;
class QToolButton;
/// Qt user interface for CMake
class CMakeSetupDialog : public QMainWindow, public Ui::CMakeSetupDialog
class CMakeSetupDialog
: public QMainWindow
, public Ui::CMakeSetupDialog
{
Q_OBJECT
public:

View File

@ -9,7 +9,9 @@
#include <ui_Compilers.h>
class Compilers : public QWidget, public Ui::Compilers
class Compilers
: public QWidget
, public Ui::Compilers
{
Q_OBJECT
public:

View File

@ -63,7 +63,9 @@ private:
};
//! the page that gives basic options for native compilers
class NativeCompilerSetup : public QWizardPage, protected Ui::Compilers
class NativeCompilerSetup
: public QWizardPage
, protected Ui::Compilers
{
Q_OBJECT
public:
@ -83,7 +85,9 @@ public:
};
//! the page that gives options for cross compilers
class CrossCompilerSetup : public QWizardPage, protected Ui::CrossCompiler
class CrossCompilerSetup
: public QWizardPage
, protected Ui::CrossCompiler
{
Q_OBJECT
public:

View File

@ -12,7 +12,9 @@
class QString;
class QWidget;
class RegexExplorer : public QDialog, public Ui::RegexExplorer
class RegexExplorer
: public QDialog
, public Ui::RegexExplorer
{
Q_OBJECT
public:

View File

@ -12,7 +12,9 @@
/**
* Dialog window for setting the warning message related options.
*/
class WarningMessagesDialog : public QDialog, public Ui_MessagesDialog
class WarningMessagesDialog
: public QDialog
, public Ui_MessagesDialog
{
Q_OBJECT

View File

@ -56,7 +56,8 @@
* Corrections (Valery Fine 16/09/96):
*
* It didn't work for C++ code with global variables and class definitions
* The DumpExternalObject function has been introduced to generate .DEF file
* The DumpExternalObject function has been introduced to generate .DEF
*file
*
* Author: Valery Fine 16/09/96 (E-mail: fine@vxcern.cern.ch)
*----------------------------------------------------------------------

View File

@ -211,7 +211,8 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
if (!aliasedTarget) {
std::ostringstream e;
e << "cannot create ALIAS target \"" << libName << "\" because target \""
<< aliasedName << "\" does not already "
<< aliasedName
<< "\" does not already "
"exist.";
this->SetError(e.str());
return false;

View File

@ -28,6 +28,7 @@ public:
void Clear() { this->IsValueSet = false; }
bool IsSet() const { return this->IsValueSet; }
T Get() const { return Value; }
private:
T Value;
bool IsValueSet;
@ -41,6 +42,7 @@ class cmArchiveWrite
{
typedef void (cmArchiveWrite::*safe_bool)();
void safe_bool_true() {}
public:
/** Compression type. */
enum Compress

View File

@ -395,8 +395,9 @@ void CCONV cmAddLibrary(void* arg, const char* libname, int shared,
for (i = 0; i < numSrcs; ++i) {
srcs2.push_back(srcs[i]);
}
mf->AddLibrary(libname, (shared ? cmStateEnums::SHARED_LIBRARY
: cmStateEnums::STATIC_LIBRARY),
mf->AddLibrary(
libname,
(shared ? cmStateEnums::SHARED_LIBRARY : cmStateEnums::STATIC_LIBRARY),
srcs2);
}

View File

@ -75,9 +75,10 @@ struct tm* cmCTest::GetNightlyTime(std::string const& str, bool tomorrowtag)
// curl_getdate no longer assumes the day is today
sprintf(buf, "%d%02d%02d %s", lctime->tm_year + 1900, lctime->tm_mon + 1,
lctime->tm_mday, str.c_str());
cmCTestLog(this, OUTPUT, "Determine Nightly Start Time"
<< std::endl
<< " Specified time: " << str << std::endl);
cmCTestLog(this, OUTPUT,
"Determine Nightly Start Time" << std::endl
<< " Specified time: " << str
<< std::endl);
// Convert the nightly start time to seconds. Since we are
// providing only a time and a timezone, the current date of
// the local machine is assumed. Consequently, nightlySeconds
@ -99,16 +100,17 @@ struct tm* cmCTest::GetNightlyTime(std::string const& str, bool tomorrowtag)
// time of the current open dashboard
ntime -= dayLength;
cmCTestLog(this, DEBUG, "Pick yesterday" << std::endl);
cmCTestLog(this, DEBUG, " Future time, subtract day: " << ntime
<< std::endl);
cmCTestLog(this, DEBUG,
" Future time, subtract day: " << ntime << std::endl);
}
while (tctime > (ntime + dayLength)) {
ntime += dayLength;
cmCTestLog(this, DEBUG, " Past time, add day: " << ntime << std::endl);
}
cmCTestLog(this, DEBUG, "nightlySeconds: " << ntime << std::endl);
cmCTestLog(this, DEBUG, " Current time: " << tctime << " Nightly time: "
<< ntime << std::endl);
cmCTestLog(this, DEBUG,
" Current time: " << tctime << " Nightly time: " << ntime
<< std::endl);
if (tomorrowtag) {
cmCTestLog(this, OUTPUT, " Use future tag, Add a day" << std::endl);
ntime += dayLength;
@ -390,11 +392,12 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
cmCTestOptionalLog(this, DEBUG, "Here: " << __LINE__ << std::endl, quiet);
if (this->ProduceXML) {
cmCTestOptionalLog(this, DEBUG, "Here: " << __LINE__ << std::endl, quiet);
cmCTestOptionalLog(
this, OUTPUT, " Site: "
cmCTestOptionalLog(this, OUTPUT,
" Site: "
<< this->GetCTestConfiguration("Site") << std::endl
<< " Build name: "
<< cmCTest::SafeBuildIdField(this->GetCTestConfiguration("BuildName"))
<< cmCTest::SafeBuildIdField(
this->GetCTestConfiguration("BuildName"))
<< std::endl,
quiet);
cmCTestOptionalLog(this, DEBUG, "Produce XML is on" << std::endl, quiet);
@ -431,16 +434,16 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
std::string testingDir = this->BinaryDir + "/Testing";
if (cmSystemTools::FileExists(testingDir)) {
if (!cmSystemTools::FileIsDirectory(testingDir)) {
cmCTestLog(this, ERROR_MESSAGE, "File "
<< testingDir
cmCTestLog(this, ERROR_MESSAGE,
"File " << testingDir
<< " is in the place of the testing directory"
<< std::endl);
return 0;
}
} else {
if (!cmSystemTools::MakeDirectory(testingDir)) {
cmCTestLog(this, ERROR_MESSAGE, "Cannot create directory "
<< testingDir << std::endl);
cmCTestLog(this, ERROR_MESSAGE,
"Cannot create directory " << testingDir << std::endl);
return 0;
}
}
@ -518,8 +521,9 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
}
ofs.close();
if (nullptr == command) {
cmCTestOptionalLog(this, OUTPUT, "Create new tag: "
<< tag << " - " << this->GetTestModelString()
cmCTestOptionalLog(this, OUTPUT,
"Create new tag: " << tag << " - "
<< this->GetTestModelString()
<< std::endl,
quiet);
}
@ -539,8 +543,9 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
}
if (tag.empty()) {
cmCTestLog(this, ERROR_MESSAGE, "Cannot read existing TAG file in "
<< testingDir << std::endl);
cmCTestLog(this, ERROR_MESSAGE,
"Cannot read existing TAG file in " << testingDir
<< std::endl);
return 0;
}
@ -558,14 +563,16 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
if (model != this->TestModel && model != cmCTest::UNKNOWN &&
this->TestModel != cmCTest::UNKNOWN) {
cmCTestOptionalLog(this, WARNING, "Model given in TAG does not match "
cmCTestOptionalLog(this, WARNING,
"Model given in TAG does not match "
"model given in ctest_start()"
<< std::endl,
quiet);
}
if (!this->SpecificTrack.empty() && track != this->SpecificTrack) {
cmCTestOptionalLog(this, WARNING, "Track given in TAG does not match "
cmCTestOptionalLog(this, WARNING,
"Track given in TAG does not match "
"track given in ctest_start()"
<< std::endl,
quiet);
@ -573,8 +580,9 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
this->SpecificTrack = track;
}
cmCTestOptionalLog(this, OUTPUT, " Use existing tag: "
<< tag << " - " << this->GetTestModelString()
cmCTestOptionalLog(this, OUTPUT,
" Use existing tag: " << tag << " - "
<< this->GetTestModelString()
<< std::endl,
quiet);
}
@ -613,8 +621,9 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command)
}
if (!fname.empty()) {
cmCTestOptionalLog(this, OUTPUT, " Reading ctest configuration file: "
<< fname << std::endl,
cmCTestOptionalLog(this, OUTPUT,
" Reading ctest configuration file: " << fname
<< std::endl,
command->ShouldBeQuiet());
bool readit = mf->ReadDependentFile(fname.c_str());
if (!readit) {
@ -629,7 +638,8 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command)
<< bld_dir_fname << std::endl,
command->ShouldBeQuiet());
cmCTestOptionalLog(
this, WARNING, "Cannot locate CTest configuration: in SourceDirectory: "
this, WARNING,
"Cannot locate CTest configuration: in SourceDirectory: "
<< src_dir_fname << std::endl,
command->ShouldBeQuiet());
}
@ -645,7 +655,8 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command)
if (dartVersion) {
this->DartVersion = atoi(dartVersion);
if (this->DartVersion < 0) {
cmCTestLog(this, ERROR_MESSAGE, "Invalid Dart server version: "
cmCTestLog(this, ERROR_MESSAGE,
"Invalid Dart server version: "
<< dartVersion << ". Please specify the version number."
<< std::endl);
return false;
@ -656,9 +667,9 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command)
if (!this->Initialize(bld_dir.c_str(), command)) {
return false;
}
cmCTestOptionalLog(this, OUTPUT, " Use "
<< this->GetTestModelString()
<< " tag: " << this->GetCurrentTag() << std::endl,
cmCTestOptionalLog(this, OUTPUT,
" Use " << this->GetTestModelString() << " tag: "
<< this->GetCurrentTag() << std::endl,
command->ShouldBeQuiet());
return true;
}
@ -677,13 +688,13 @@ bool cmCTest::UpdateCTestConfiguration()
if (!cmSystemTools::FileExists(fileName)) {
// No need to exit if we are not producing XML
if (this->ProduceXML) {
cmCTestLog(this, ERROR_MESSAGE, "Cannot find file: " << fileName
<< std::endl);
cmCTestLog(this, ERROR_MESSAGE,
"Cannot find file: " << fileName << std::endl);
return false;
}
} else {
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Parse Config file:" << fileName
<< "\n");
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
"Parse Config file:" << fileName << "\n");
// parse the dart test file
cmsys::ifstream fin(fileName.c_str());
@ -774,8 +785,9 @@ bool cmCTest::SetTest(const char* ttype, bool report)
return true;
}
if (report) {
cmCTestLog(this, ERROR_MESSAGE, "Don't know about test \""
<< ttype << "\" yet..." << std::endl);
cmCTestLog(this, ERROR_MESSAGE,
"Don't know about test \"" << ttype << "\" yet..."
<< std::endl);
}
return false;
}
@ -793,23 +805,24 @@ bool cmCTest::OpenOutputFile(const std::string& path, const std::string& name,
}
if (cmSystemTools::FileExists(testingDir)) {
if (!cmSystemTools::FileIsDirectory(testingDir)) {
cmCTestLog(this, ERROR_MESSAGE, "File "
<< testingDir << " is in the place of the testing directory"
cmCTestLog(this, ERROR_MESSAGE,
"File " << testingDir
<< " is in the place of the testing directory"
<< std::endl);
return false;
}
} else {
if (!cmSystemTools::MakeDirectory(testingDir)) {
cmCTestLog(this, ERROR_MESSAGE, "Cannot create directory " << testingDir
<< std::endl);
cmCTestLog(this, ERROR_MESSAGE,
"Cannot create directory " << testingDir << std::endl);
return false;
}
}
std::string filename = testingDir + "/" + name;
stream.Open(filename.c_str());
if (!stream) {
cmCTestLog(this, ERROR_MESSAGE, "Problem opening file: " << filename
<< std::endl);
cmCTestLog(this, ERROR_MESSAGE,
"Problem opening file: " << filename << std::endl);
return false;
}
if (compress) {
@ -1048,8 +1061,9 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
int length;
cmProcessOutput processOutput(encoding);
std::string strdata;
cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, " Each . represents "
<< tick_len << " bytes of output" << std::endl
cmCTestLog(this, HANDLER_PROGRESS_OUTPUT,
" Each . represents " << tick_len << " bytes of output"
<< std::endl
<< " " << std::flush);
while (cmsysProcess_WaitForData(cp, &data, &length, nullptr)) {
processOutput.DecodeText(data, length, strdata);
@ -1084,8 +1098,9 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
ofs << cmCTestLogWrite(strdata.c_str(), strdata.size());
}
}
cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, " Size of output: "
<< int(double(output.size()) / 1024.0) << "K" << std::endl);
cmCTestLog(this, HANDLER_PROGRESS_OUTPUT,
" Size of output: " << int(double(output.size()) / 1024.0) << "K"
<< std::endl);
cmsysProcess_WaitForExit(cp, nullptr);
@ -1097,16 +1112,17 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
"Command exited with the value: " << *retVal << std::endl);
} else if (result == cmsysProcess_State_Exception) {
*retVal = cmsysProcess_GetExitException(cp);
cmCTestLog(this, WARNING, "There was an exception: " << *retVal
<< std::endl);
cmCTestLog(this, WARNING,
"There was an exception: " << *retVal << std::endl);
} else if (result == cmsysProcess_State_Expired) {
cmCTestLog(this, WARNING, "There was a timeout" << std::endl);
} else if (result == cmsysProcess_State_Error) {
output += "\n*** ERROR executing: ";
output += cmsysProcess_GetErrorString(cp);
output += "\n***The build process failed.";
cmCTestLog(this, ERROR_MESSAGE, "There was an error: "
<< cmsysProcess_GetErrorString(cp) << std::endl);
cmCTestLog(this, ERROR_MESSAGE,
"There was an error: " << cmsysProcess_GetErrorString(cp)
<< std::endl);
}
cmsysProcess_Delete(cp);
@ -1142,7 +1158,8 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
if (timeout <= cmDuration::zero()) {
timeout = std::chrono::seconds(1);
}
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Test timeout computed to be: "
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
"Test timeout computed to be: "
<< (timeout == cmCTest::MaxDuration()
? std::string("infinite")
: std::to_string(cmDurationTo<unsigned int>(timeout)))
@ -1250,8 +1267,8 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
if (output && tempOutput.begin() != tempOutput.end()) {
output->append(&*tempOutput.begin(), tempOutput.size());
}
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "-- Process completed"
<< std::endl);
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
"-- Process completed" << std::endl);
int result = cmsysProcess_GetState(cp);
@ -1270,7 +1287,8 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
if (output) {
*output += outerr;
}
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr << std::endl
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
outerr << std::endl
<< std::flush);
} else if (result == cmsysProcess_State_Error) {
std::string outerr = "\n*** ERROR executing: ";
@ -1278,7 +1296,8 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
if (output) {
*output += outerr;
}
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr << std::endl
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
outerr << std::endl
<< std::flush);
}
cmsysProcess_Delete(cp);
@ -1319,7 +1338,8 @@ std::string cmCTest::SafeBuildIdField(const std::string& value)
void cmCTest::StartXML(cmXMLWriter& xml, bool append)
{
if (this->CurrentTag.empty()) {
cmCTestLog(this, ERROR_MESSAGE, "Current Tag empty, this may mean"
cmCTestLog(this, ERROR_MESSAGE,
"Current Tag empty, this may mean"
" NightlStartTime was not set correctly."
<< std::endl);
cmSystemTools::SetFatalErrorOccured();
@ -1489,8 +1509,9 @@ int cmCTest::GenerateCTestNotesOutput(cmXMLWriter& xml,
ifs.close();
} else {
xml.Content("Problem reading file: " + file + "\n");
cmCTestLog(this, ERROR_MESSAGE, "Problem reading file: "
<< file << " while creating notes" << std::endl);
cmCTestLog(this, ERROR_MESSAGE,
"Problem reading file: " << file << " while creating notes"
<< std::endl);
}
xml.EndElement(); // Text
xml.EndElement(); // Note
@ -1539,7 +1560,8 @@ std::string cmCTest::Base64GzipEncodeFile(std::string const& file)
if (!cmSystemTools::CreateTar(tarFile.c_str(), files,
cmSystemTools::TarCompressGZip, false)) {
cmCTestLog(this, ERROR_MESSAGE, "Error creating tar while "
cmCTestLog(this, ERROR_MESSAGE,
"Error creating tar while "
"encoding file: "
<< file << std::endl);
return "";
@ -1552,7 +1574,8 @@ std::string cmCTest::Base64GzipEncodeFile(std::string const& file)
std::string cmCTest::Base64EncodeFile(std::string const& file)
{
size_t const len = cmSystemTools::FileLength(file);
cmsys::ifstream ifs(file.c_str(), std::ios::in
cmsys::ifstream ifs(file.c_str(),
std::ios::in
#ifdef _WIN32
| std::ios::binary
#endif
@ -1574,8 +1597,9 @@ bool cmCTest::SubmitExtraFiles(const VectorOfStrings& files)
{
for (cmsys::String const& file : files) {
if (!cmSystemTools::FileExists(file)) {
cmCTestLog(this, ERROR_MESSAGE, "Cannot find extra file: "
<< file << " to submit." << std::endl;);
cmCTestLog(this, ERROR_MESSAGE,
"Cannot find extra file: " << file << " to submit."
<< std::endl;);
return false;
}
this->AddSubmitFile(PartExtraFiles, file.c_str());
@ -1732,7 +1756,8 @@ void cmCTest::ErrorMessageUnknownDashDValue(std::string& val)
"CTest -D called with incorrect option: " << val << std::endl);
cmCTestLog(
this, ERROR_MESSAGE, "Available options are:"
this, ERROR_MESSAGE,
"Available options are:"
<< std::endl
<< " ctest -D Continuous" << std::endl
<< " ctest -D Continuous(Start|Update|Configure|Build)" << std::endl
@ -2191,9 +2216,11 @@ bool cmCTest::HandleTestActionArgument(const char* ctestExec, size_t& i,
i++;
if (!this->SetTest(args[i].c_str(), false)) {
success = false;
cmCTestLog(this, ERROR_MESSAGE, "CTest -T called with incorrect option: "
<< args[i] << std::endl);
cmCTestLog(this, ERROR_MESSAGE, "Available options are:"
cmCTestLog(this, ERROR_MESSAGE,
"CTest -T called with incorrect option: " << args[i]
<< std::endl);
cmCTestLog(this, ERROR_MESSAGE,
"Available options are:"
<< std::endl
<< " " << ctestExec << " -T all" << std::endl
<< " " << ctestExec << " -T start" << std::endl
@ -2227,9 +2254,11 @@ bool cmCTest::HandleTestModelArgument(const char* ctestExec, size_t& i,
this->SetTestModel(cmCTest::EXPERIMENTAL);
} else {
success = false;
cmCTestLog(this, ERROR_MESSAGE, "CTest -M called with incorrect option: "
<< str << std::endl);
cmCTestLog(this, ERROR_MESSAGE, "Available options are:"
cmCTestLog(this, ERROR_MESSAGE,
"CTest -M called with incorrect option: " << str
<< std::endl);
cmCTestLog(this, ERROR_MESSAGE,
"Available options are:"
<< std::endl
<< " " << ctestExec << " -M Continuous" << std::endl
<< " " << ctestExec << " -M Experimental" << std::endl
@ -2270,8 +2299,8 @@ int cmCTest::ExecuteTests()
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
if (!this->Initialize(cwd.c_str(), nullptr)) {
res = 12;
cmCTestLog(this, ERROR_MESSAGE, "Problem initializing the dashboard."
<< std::endl);
cmCTestLog(this, ERROR_MESSAGE,
"Problem initializing the dashboard." << std::endl);
} else {
res = this->ProcessSteps();
}
@ -2295,8 +2324,8 @@ int cmCTest::RunCMakeAndTest(std::string* output)
cmDynamicLoader::FlushCache();
#endif
if (retv != 0) {
cmCTestLog(this, DEBUG, "build and test failing returning: " << retv
<< std::endl);
cmCTestLog(this, DEBUG,
"build and test failing returning: " << retv << std::endl);
}
return retv;
}
@ -2351,22 +2380,25 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf)
bool found = false;
VectorOfStrings dirs;
VectorOfStrings ndirs;
cmCTestLog(this, DEBUG, "* Read custom CTest configuration directory: "
<< dir << std::endl);
cmCTestLog(this, DEBUG,
"* Read custom CTest configuration directory: " << dir
<< std::endl);
std::string fname = dir;
fname += "/CTestCustom.cmake";
cmCTestLog(this, DEBUG, "* Check for file: " << fname << std::endl);
if (cmSystemTools::FileExists(fname)) {
cmCTestLog(this, DEBUG, "* Read custom CTest configuration file: "
<< fname << std::endl);
cmCTestLog(this, DEBUG,
"* Read custom CTest configuration file: " << fname
<< std::endl);
bool erroroc = cmSystemTools::GetErrorOccuredFlag();
cmSystemTools::ResetErrorOccuredFlag();
if (!mf->ReadListFile(fname.c_str()) ||
cmSystemTools::GetErrorOccuredFlag()) {
cmCTestLog(this, ERROR_MESSAGE, "Problem reading custom configuration: "
<< fname << std::endl);
cmCTestLog(this, ERROR_MESSAGE,
"Problem reading custom configuration: " << fname
<< std::endl);
}
found = true;
if (erroroc) {
@ -2384,8 +2416,9 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf)
std::vector<std::string>& files = gl.GetFiles();
std::vector<std::string>::iterator fileIt;
for (fileIt = files.begin(); fileIt != files.end(); ++fileIt) {
cmCTestLog(this, DEBUG, "* Read custom CTest configuration file: "
<< *fileIt << std::endl);
cmCTestLog(this, DEBUG,
"* Read custom CTest configuration file: " << *fileIt
<< std::endl);
if (!mf->ReadListFile(fileIt->c_str()) ||
cmSystemTools::GetErrorOccuredFlag()) {
cmCTestLog(this, ERROR_MESSAGE,
@ -2398,9 +2431,10 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf)
if (found) {
for (auto& handler : this->TestingHandlers) {
cmCTestLog(
this, DEBUG, "* Read custom CTest configuration vectors for handler: "
<< handler.first << " (" << handler.second << ")" << std::endl);
cmCTestLog(this, DEBUG,
"* Read custom CTest configuration vectors for handler: "
<< handler.first << " (" << handler.second << ")"
<< std::endl);
handler.second->PopulateCustomVectors(mf);
}
}
@ -2502,7 +2536,8 @@ void cmCTest::EmptyCTestConfiguration()
void cmCTest::SetCTestConfiguration(const char* name, const char* value,
bool suppress)
{
cmCTestOptionalLog(this, HANDLER_VERBOSE_OUTPUT, "SetCTestConfiguration:"
cmCTestOptionalLog(this, HANDLER_VERBOSE_OUTPUT,
"SetCTestConfiguration:"
<< name << ":" << (value ? value : "(null)") << "\n",
suppress);
@ -2889,8 +2924,8 @@ bool cmCTest::CompressString(std::string& str)
ret = deflate(&strm, Z_FINISH);
if (ret != Z_STREAM_END) {
cmCTestLog(this, ERROR_MESSAGE, "Error during gzip compression."
<< std::endl);
cmCTestLog(this, ERROR_MESSAGE,
"Error during gzip compression." << std::endl);
return false;
}

View File

@ -566,7 +566,8 @@ void cmCacheManager::AddCacheEntry(const std::string& key, const char* value,
cmSystemTools::ConvertToUnixSlashes(e.Value);
}
}
e.SetProperty("HELPSTRING", helpString
e.SetProperty("HELPSTRING",
helpString
? helpString
: "(This variable does not exist and should not be used)");
}

View File

@ -98,6 +98,7 @@ public:
/** Is there a keyword which should be skipped in
the arguments (e.g. ARGS for ADD_CUSTOM_COMMAND) ? */
void SetIgnore(const char* ignore) { this->Ignore = ignore; }
private:
std::vector<std::string> Vector;
unsigned int DataStart;
@ -118,6 +119,7 @@ public:
/// Return the string
const std::string& GetString() const { return this->String; }
const char* GetCString() const { return this->String.c_str(); }
private:
std::string String;
unsigned int DataStart;
@ -136,6 +138,7 @@ public:
/// Has it been enabled ?
bool IsEnabled() const { return this->Enabled; }
private:
bool Enabled;
bool DoConsume(const std::string& arg, unsigned int index) override;
@ -153,6 +156,7 @@ public:
/// Is it still enabled ?
bool IsEnabled() const { return this->Enabled; }
private:
bool Enabled;
bool DoConsume(const std::string& arg, unsigned int index) override;

View File

@ -155,30 +155,37 @@ void GetScriptingCommands(cmState* state)
state->AddBuiltinCommand("while", new cmWhileCommand);
state->AddUnexpectedCommand(
"else", "An ELSE command was found outside of a proper "
"else",
"An ELSE command was found outside of a proper "
"IF ENDIF structure. Or its arguments did not match "
"the opening IF command.");
state->AddUnexpectedCommand(
"elseif", "An ELSEIF command was found outside of a proper "
"elseif",
"An ELSEIF command was found outside of a proper "
"IF ENDIF structure.");
state->AddUnexpectedCommand(
"endforeach", "An ENDFOREACH command was found outside of a proper "
"endforeach",
"An ENDFOREACH command was found outside of a proper "
"FOREACH ENDFOREACH structure. Or its arguments did "
"not match the opening FOREACH command.");
state->AddUnexpectedCommand(
"endfunction", "An ENDFUNCTION command was found outside of a proper "
"endfunction",
"An ENDFUNCTION command was found outside of a proper "
"FUNCTION ENDFUNCTION structure. Or its arguments did not "
"match the opening FUNCTION command.");
state->AddUnexpectedCommand(
"endif", "An ENDIF command was found outside of a proper "
"endif",
"An ENDIF command was found outside of a proper "
"IF ENDIF structure. Or its arguments did not match "
"the opening IF command.");
state->AddUnexpectedCommand(
"endmacro", "An ENDMACRO command was found outside of a proper "
"endmacro",
"An ENDMACRO command was found outside of a proper "
"MACRO ENDMACRO structure. Or its arguments did not "
"match the opening MACRO command.");
state->AddUnexpectedCommand(
"endwhile", "An ENDWHILE command was found outside of a proper "
"endwhile",
"An ENDWHILE command was found outside of a proper "
"WHILE ENDWHILE structure. Or its arguments did not "
"match the opening WHILE command.");

View File

@ -149,7 +149,8 @@ std::vector<std::string> cmCommonTargetGenerator::GetLinkedTargetDirectories()
cmComputeLinkInformation::ItemVector const& items = cli->GetItems();
for (auto const& item : items) {
cmGeneratorTarget const* linkee = item.Target;
if (linkee && !linkee->IsImported()
if (linkee &&
!linkee->IsImported()
// We can ignore the INTERFACE_LIBRARY items because
// Target->GetLinkInformation already processed their
// link interface and they don't have any output themselves.

View File

@ -239,7 +239,8 @@ cmComputeLinkDepends::Compute()
// Display the constraint graph.
if (this->DebugMode) {
fprintf(stderr, "---------------------------------------"
fprintf(stderr,
"---------------------------------------"
"---------------------------------------\n");
fprintf(stderr, "Link dependency analysis for target %s, config %s\n",
this->Target->GetName().c_str(),

View File

@ -241,13 +241,12 @@ because this need be done only for shared libraries without soname-s.
cmComputeLinkInformation::cmComputeLinkInformation(
const cmGeneratorTarget* target, const std::string& config)
// Store context information.
: Target(target),
Makefile(target->Target->GetMakefile()),
GlobalGenerator(target->GetLocalGenerator()->GetGlobalGenerator()),
CMakeInstance(this->GlobalGenerator->GetCMakeInstance())
: Target(target)
, Makefile(target->Target->GetMakefile())
, GlobalGenerator(target->GetLocalGenerator()->GetGlobalGenerator())
, CMakeInstance(this->GlobalGenerator->GetCMakeInstance())
// The configuration being linked.
,
Config(config)
, Config(config)
{
// Check whether to recognize OpenBSD-style library versioned names.
this->OpenBSD = this->Makefile->GetState()->GetGlobalPropertyAsBool(

View File

@ -65,6 +65,7 @@ public:
std::string GetRPathLinkString() const;
std::string GetConfig() const { return this->Config; }
private:
void AddItem(std::string const& item, const cmGeneratorTarget* tgt);
void AddSharedDepItem(std::string const& item, cmGeneratorTarget const* tgt);

View File

@ -82,16 +82,19 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
if (strcmp(tt, cmState::GetTargetTypeName(cmStateEnums::EXECUTABLE)) ==
0) {
targetType = cmStateEnums::EXECUTABLE;
} else if (strcmp(tt, cmState::GetTargetTypeName(
} else if (strcmp(tt,
cmState::GetTargetTypeName(
cmStateEnums::STATIC_LIBRARY)) == 0) {
targetType = cmStateEnums::STATIC_LIBRARY;
} else {
this->Makefile->IssueMessage(
cmake::FATAL_ERROR, std::string("Invalid value '") + tt +
cmake::FATAL_ERROR,
std::string("Invalid value '") + tt +
"' for "
"CMAKE_TRY_COMPILE_TARGET_TYPE. Only "
"'" +
cmState::GetTargetTypeName(cmStateEnums::EXECUTABLE) + "' and "
cmState::GetTargetTypeName(cmStateEnums::EXECUTABLE) +
"' and "
"'" +
cmState::GetTargetTypeName(cmStateEnums::STATIC_LIBRARY) +
"' "
@ -224,7 +227,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
cmake::FATAL_ERROR,
"Only libraries may be used as try_compile or try_run IMPORTED "
"LINK_LIBRARIES. Got " +
std::string(tgt->GetName()) + " of "
std::string(tgt->GetName()) +
" of "
"type " +
cmState::GetTargetTypeName(tgt->GetType()) + ".");
return -1;
@ -487,7 +491,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
const char* flags = this->Makefile->GetDefinition(langFlags);
fprintf(fout, "set(CMAKE_%s_FLAGS %s)\n", li.c_str(),
cmOutputConverter::EscapeForCMake(flags ? flags : "").c_str());
fprintf(fout, "set(CMAKE_%s_FLAGS \"${CMAKE_%s_FLAGS}"
fprintf(fout,
"set(CMAKE_%s_FLAGS \"${CMAKE_%s_FLAGS}"
" ${COMPILE_DEFINITIONS}\")\n",
li.c_str(), li.c_str());
}
@ -563,7 +568,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
}
break;
}
fprintf(fout, "set(CMAKE_EXE_LINKER_FLAGS \"${CMAKE_EXE_LINKER_FLAGS}"
fprintf(fout,
"set(CMAKE_EXE_LINKER_FLAGS \"${CMAKE_EXE_LINKER_FLAGS}"
" ${EXE_LINKER_FLAGS}\")\n");
fprintf(fout, "include_directories(${INCLUDE_DIRECTORIES})\n");
fprintf(fout, "set(CMAKE_SUPPRESS_REGENERATION 1)\n");

View File

@ -162,6 +162,7 @@ public:
// Return the recorded ELF type.
cmELF::FileType GetFileType() const { return this->ELFType; }
protected:
// Data common to all ELF class implementations.

View File

@ -266,9 +266,11 @@ static bool checkInterfaceDirs(const std::string& prepro,
s << "Directory:\n \"" << li
<< "\"\nin "
"INTERFACE_INCLUDE_DIRECTORIES of target \""
<< target->GetName() << "\" is a subdirectory of the install "
<< target->GetName()
<< "\" is a subdirectory of the install "
"directory:\n \""
<< installDir << "\"\nhowever it is also "
<< installDir
<< "\"\nhowever it is also "
"a subdirectory of the "
<< (inBinary ? "build" : "source") << " tree:\n \""
<< (inBinary ? topBinaryDir : topSourceDir) << "\""

View File

@ -26,6 +26,7 @@ public:
/** Set the list of targets to export. */
void SetConfig(const std::string& config) { this->Config = config; }
protected:
// Implement virtual methods from the superclass.
bool GenerateMainFile(std::ostream& os) override;

View File

@ -614,23 +614,27 @@ void cmExtraCodeBlocksGenerator::AppendTarget(
xml.StartElement("MakeCommands");
xml.StartElement("Build");
xml.Attribute("command", this->BuildMakeCommand(make, makefileName.c_str(),
targetName, makeFlags));
xml.Attribute(
"command",
this->BuildMakeCommand(make, makefileName.c_str(), targetName, makeFlags));
xml.EndElement();
xml.StartElement("CompileFile");
xml.Attribute("command", this->BuildMakeCommand(make, makefileName.c_str(),
"\"$file\"", makeFlags));
xml.Attribute("command",
this->BuildMakeCommand(make, makefileName.c_str(), "\"$file\"",
makeFlags));
xml.EndElement();
xml.StartElement("Clean");
xml.Attribute("command", this->BuildMakeCommand(make, makefileName.c_str(),
"clean", makeFlags));
xml.Attribute(
"command",
this->BuildMakeCommand(make, makefileName.c_str(), "clean", makeFlags));
xml.EndElement();
xml.StartElement("DistClean");
xml.Attribute("command", this->BuildMakeCommand(make, makefileName.c_str(),
"clean", makeFlags));
xml.Attribute(
"command",
this->BuildMakeCommand(make, makefileName.c_str(), "clean", makeFlags));
xml.EndElement();
xml.EndElement(); // MakeCommands

View File

@ -277,7 +277,8 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
xml.StartDocument("UTF-8");
xml.StartElement("projectDescription");
xml.Element("name", this->GenerateProjectName(
xml.Element("name",
this->GenerateProjectName(
lg->GetProjectName(),
mf->GetSafeDefinition("CMAKE_BUILD_TYPE"),
this->GetPathBasename(this->HomeOutputDirectory)));
@ -641,7 +642,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
xml.EndElement(); // extension
} else if (systemName == "Darwin") {
xml.StartElement("extension");
xml.Attribute("id", this->SupportsMachO64Parser
xml.Attribute("id",
this->SupportsMachO64Parser
? "org.eclipse.cdt.core.MachO64"
: "org.eclipse.cdt.core.MachO");
xml.Attribute("point", "org.eclipse.cdt.core.BinaryParser");

View File

@ -199,7 +199,8 @@ void cmExtraKateGenerator::AppendTarget(cmGeneratedFileStream& fout,
{
static char JsonSep = ' ';
fout << "\t\t\t" << JsonSep << "{\"name\":\"" << target << "\", "
fout << "\t\t\t" << JsonSep << "{\"name\":\"" << target
<< "\", "
"\"build_cmd\":\""
<< make << " -C \\\"" << (this->UseNinja ? homeOutputDir : path)
<< "\\\" " << makeArgs << " " << target << "\"}\n";

View File

@ -400,8 +400,9 @@ std::string cmExtraSublimeTextGenerator::ComputeDefines(
std::string defPropName = "COMPILE_DEFINITIONS_";
defPropName += cmSystemTools::UpperCase(config);
if (const char* config_compile_defs = source->GetProperty(defPropName)) {
lg->AppendDefines(defines, genexInterpreter.Evaluate(config_compile_defs,
COMPILE_DEFINITIONS));
lg->AppendDefines(
defines,
genexInterpreter.Evaluate(config_compile_defs, COMPILE_DEFINITIONS));
}
std::string definesString;

View File

@ -282,7 +282,8 @@ bool cmFileCommand::HandleReadCommand(std::vector<std::string> const& args)
// Open the specified file.
#if defined(_WIN32) || defined(__CYGWIN__)
cmsys::ifstream file(
fileName.c_str(), std::ios::in |
fileName.c_str(),
std::ios::in |
(hexOutputArg.IsEnabled() ? std::ios::binary : std::ios::in));
#else
cmsys::ifstream file(fileName.c_str());
@ -327,8 +328,9 @@ bool cmFileCommand::HandleReadCommand(std::vector<std::string> const& args)
} else {
std::string line;
bool has_newline = false;
while (sizeLimit != 0 && cmSystemTools::GetLineFromStream(
file, line, &has_newline, sizeLimit)) {
while (
sizeLimit != 0 &&
cmSystemTools::GetLineFromStream(file, line, &has_newline, sizeLimit)) {
if (sizeLimit > 0) {
sizeLimit = sizeLimit - static_cast<long>(line.size());
if (has_newline) {
@ -616,7 +618,9 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
} else if (encoding == encoding_utf8) {
// Check for UTF-8 encoded string (up to 4 octets)
static const unsigned char utf8_check_table[3][2] = {
{ 0xE0, 0xC0 }, { 0xF0, 0xE0 }, { 0xF8, 0xF0 },
{ 0xE0, 0xC0 },
{ 0xF0, 0xE0 },
{ 0xF8, 0xF0 },
};
// how many octets are there?
@ -865,8 +869,9 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
globMessage.content);
} else {
this->Makefile->IssueMessage(
cmake::FATAL_ERROR, "Error has occurred while globbing for '" +
*i + "' - " + globMessage.content);
cmake::FATAL_ERROR,
"Error has occurred while globbing for '" + *i + "' - " +
globMessage.content);
shouldExit = true;
}
}

View File

@ -525,9 +525,11 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args,
"Add NO_MODULE to exclusively request Config mode and search for a "
"package configuration file provided by "
<< this->Name << " (" << this->Name << "Config.cmake or "
<< cmSystemTools::LowerCase(this->Name) << "-config.cmake). "
<< cmSystemTools::LowerCase(this->Name)
<< "-config.cmake). "
"Otherwise make Find"
<< this->Name << ".cmake available in "
<< this->Name
<< ".cmake available in "
"CMAKE_MODULE_PATH.";
}
aw << "\n"
@ -764,7 +766,8 @@ bool cmFindPackageCommand::HandlePackageMode()
if (result && !found) {
// warn if package required or neither quiet nor in config mode
if (this->Required ||
!(this->Quiet || (this->UseConfigFiles && !this->UseFindModules &&
!(this->Quiet ||
(this->UseConfigFiles && !this->UseFindModules &&
this->ConsideredConfigs.empty()))) {
// The variable is not set.
std::ostringstream e;
@ -810,7 +813,8 @@ bool cmFindPackageCommand::HandlePackageMode()
<< ".cmake\" in "
"CMAKE_MODULE_PATH this project has asked CMake to find a "
"package configuration file provided by \""
<< this->Name << "\", "
<< this->Name
<< "\", "
"but CMake did not find one.\n";
}
@ -832,7 +836,8 @@ bool cmFindPackageCommand::HandlePackageMode()
<< "\" to a "
"directory containing one of the above files. "
"If \""
<< this->Name << "\" provides a separate development "
<< this->Name
<< "\" provides a separate development "
"package or SDK, be sure it has been installed.";
} else // if(!this->UseFindModules && !this->UseConfigFiles)
{

View File

@ -67,8 +67,9 @@ protected:
* contents have changed to prevent the file modification time from
* being updated.
*/
class cmGeneratedFileStream : private cmGeneratedFileStreamBase,
public cmsys::ofstream
class cmGeneratedFileStream
: private cmGeneratedFileStreamBase
, public cmsys::ofstream
{
public:
typedef cmsys::ofstream Stream;

View File

@ -41,8 +41,9 @@ std::string GeneratorExpressionContent::ProcessArbitraryContent(
for (; it != end; ++it) {
if (node->RequiresLiteralInput()) {
if ((*it)->GetType() != cmGeneratorExpressionEvaluator::Text) {
reportError(context, this->GetOriginalExpression(), "$<" +
identifier + "> expression requires literal input.");
reportError(context, this->GetOriginalExpression(),
"$<" + identifier +
"> expression requires literal input.");
return std::string();
}
}
@ -157,7 +158,8 @@ std::string GeneratorExpressionContent::EvaluateParameters(
reportError(context, this->GetOriginalExpression(),
"$<" + identifier + "> expression requires no parameters.");
} else if (numExpected == 1) {
reportError(context, this->GetOriginalExpression(), "$<" + identifier +
reportError(context, this->GetOriginalExpression(),
"$<" + identifier +
"> expression requires "
"exactly one parameter.");
} else {
@ -172,12 +174,14 @@ std::string GeneratorExpressionContent::EvaluateParameters(
if (numExpected == cmGeneratorExpressionNode::OneOrMoreParameters &&
parameters.empty()) {
reportError(context, this->GetOriginalExpression(), "$<" + identifier +
reportError(context, this->GetOriginalExpression(),
"$<" + identifier +
"> expression requires at least one parameter.");
}
if (numExpected == cmGeneratorExpressionNode::OneOrZeroParameters &&
parameters.size() > 1) {
reportError(context, this->GetOriginalExpression(), "$<" + identifier +
reportError(context, this->GetOriginalExpression(),
"$<" + identifier +
"> expression requires one or zero parameters.");
}
return std::string();

View File

@ -1421,7 +1421,8 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
std::ostringstream e;
e << "The evaluation of the TARGET_OBJECTS generator expression "
"is only suitable for consumption by CMake (limited"
<< reason << "). "
<< reason
<< "). "
"It is not suitable for writing out elsewhere.";
reportError(context, content->GetOriginalExpression(), e.str());
return std::string();
@ -1904,11 +1905,13 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
}
if (target->GetType() >= cmStateEnums::OBJECT_LIBRARY &&
target->GetType() != cmStateEnums::UNKNOWN_LIBRARY) {
::reportError(context, content->GetOriginalExpression(), "Target \"" +
name + "\" is not an executable or library.");
::reportError(context, content->GetOriginalExpression(),
"Target \"" + name +
"\" is not an executable or library.");
return std::string();
}
if (dagChecker && (dagChecker->EvaluatingLinkLibraries(name.c_str()) ||
if (dagChecker &&
(dagChecker->EvaluatingLinkLibraries(name.c_str()) ||
(dagChecker->EvaluatingSources() &&
name == dagChecker->TopTarget()))) {
::reportError(context, content->GetOriginalExpression(),

View File

@ -87,9 +87,9 @@ void cmGeneratorExpressionParser::ParseGeneratorExpression(
if (this->it != this->Tokens.end() &&
this->it->TokenType == cmGeneratorExpressionToken::EndExpression) {
GeneratorExpressionContent* content =
new GeneratorExpressionContent(startToken->Content, this->it->Content -
startToken->Content + this->it->Length);
GeneratorExpressionContent* content = new GeneratorExpressionContent(
startToken->Content,
this->it->Content - startToken->Content + this->it->Length);
assert(this->it != this->Tokens.end());
++this->it;
--this->NestingLevel;

View File

@ -46,8 +46,9 @@ const char* cmTargetPropertyComputer::GetSources<cmGeneratorTarget>(
}
template <>
const char* cmTargetPropertyComputer::ComputeLocationForBuild<
cmGeneratorTarget>(cmGeneratorTarget const* tgt)
const char*
cmTargetPropertyComputer::ComputeLocationForBuild<cmGeneratorTarget>(
cmGeneratorTarget const* tgt)
{
return tgt->GetLocation("");
}
@ -893,8 +894,9 @@ static bool processSources(
}
if (!usedSources.empty()) {
tgt->GetLocalGenerator()->GetCMakeInstance()->IssueMessage(
cmake::LOG, std::string("Used sources for target ") + tgt->GetName() +
":\n" + usedSources,
cmake::LOG,
std::string("Used sources for target ") + tgt->GetName() + ":\n" +
usedSources,
entry->ge->GetBacktrace());
}
}
@ -2553,8 +2555,9 @@ static void processIncludeDirectories(
}
if (!usedIncludes.empty()) {
tgt->GetLocalGenerator()->GetCMakeInstance()->IssueMessage(
cmake::LOG, std::string("Used includes for target ") + tgt->GetName() +
":\n" + usedIncludes,
cmake::LOG,
std::string("Used includes for target ") + tgt->GetName() + ":\n" +
usedIncludes,
entry->ge->GetBacktrace());
}
}
@ -2661,8 +2664,9 @@ static void processCompileOptionsInternal(
}
if (!usedOptions.empty()) {
tgt->GetLocalGenerator()->GetCMakeInstance()->IssueMessage(
cmake::LOG, std::string("Used compile ") + logName +
std::string(" for target ") + tgt->GetName() + ":\n" + usedOptions,
cmake::LOG,
std::string("Used compile ") + logName + std::string(" for target ") +
tgt->GetName() + ":\n" + usedOptions,
entry->ge->GetBacktrace());
}
}
@ -3958,7 +3962,8 @@ PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt,
e << "Property " << p << " on target \"" << tgt->GetName()
<< "\" does\nnot match the "
"INTERFACE_"
<< p << " property requirement\nof "
<< p
<< " property requirement\nof "
"dependency \""
<< theTarget->GetName() << "\".\n";
cmSystemTools::Error(e.str().c_str());

View File

@ -118,8 +118,8 @@ void cmGhsMultiTargetGenerator::Generate()
config = cmSystemTools::UpperCase(config);
this->DynamicDownload = this->DetermineIfDynamicDownload(config, language);
if (this->DynamicDownload) {
*this->GetFolderBuildStreams() << "#component integrity_dynamic_download"
<< std::endl;
*this->GetFolderBuildStreams()
<< "#component integrity_dynamic_download" << std::endl;
}
GhsMultiGpj::WriteGpjTag(this->GetGpjTag(), this->GetFolderBuildStreams());
cmGlobalGhsMultiGenerator::WriteDisclaimer(this->GetFolderBuildStreams());
@ -198,8 +198,8 @@ void cmGhsMultiTargetGenerator::WriteTypeSpecifics(const std::string& config,
if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) {
std::string const static_library_suffix =
this->Makefile->GetSafeDefinition("CMAKE_STATIC_LIBRARY_SUFFIX");
*this->GetFolderBuildStreams() << " -o \"" << outputDir
<< outputFilename << static_library_suffix
*this->GetFolderBuildStreams()
<< " -o \"" << outputDir << outputFilename << static_library_suffix
<< "\"" << std::endl;
} else if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE) {
if (notKernel && !this->IsTargetGroup()) {
@ -208,14 +208,14 @@ void cmGhsMultiTargetGenerator::WriteTypeSpecifics(const std::string& config,
if (this->IsTargetGroup()) {
*this->GetFolderBuildStreams()
<< " -o \"" << outputDir << outputFilename << ".elf\"" << std::endl;
*this->GetFolderBuildStreams() << " :extraOutputFile=\"" << outputDir
<< outputFilename << ".elf.ael\""
<< std::endl;
*this->GetFolderBuildStreams()
<< " :extraOutputFile=\"" << outputDir << outputFilename
<< ".elf.ael\"" << std::endl;
} else {
std::string const executable_suffix =
this->Makefile->GetSafeDefinition("CMAKE_EXECUTABLE_SUFFIX");
*this->GetFolderBuildStreams() << " -o \"" << outputDir
<< outputFilename << executable_suffix
*this->GetFolderBuildStreams()
<< " -o \"" << outputDir << outputFilename << executable_suffix
<< "\"" << std::endl;
}
}
@ -293,8 +293,8 @@ void cmGhsMultiTargetGenerator::WriteCompilerFlags(std::string const&,
this->FlagsByLanguage.find(language);
if (flagsByLangI != this->FlagsByLanguage.end()) {
if (!flagsByLangI->second.empty()) {
*this->GetFolderBuildStreams() << " " << flagsByLangI->second
<< std::endl;
*this->GetFolderBuildStreams()
<< " " << flagsByLangI->second << std::endl;
}
}
}
@ -321,8 +321,8 @@ void cmGhsMultiTargetGenerator::WriteIncludes(const std::string& config,
for (std::vector<std::string>::const_iterator includes_i = includes.begin();
includes_i != includes.end(); ++includes_i) {
*this->GetFolderBuildStreams() << " -I\"" << *includes_i << "\""
<< std::endl;
*this->GetFolderBuildStreams()
<< " -I\"" << *includes_i << "\"" << std::endl;
}
}
@ -335,8 +335,8 @@ void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries(
for (cmTargetDependSet::iterator tdsI = tds.begin(); tdsI != tds.end();
++tdsI) {
const cmGeneratorTarget* tg = *tdsI;
*this->GetFolderBuildStreams() << " -L\"" << GetAbsBuildFilePath(tg)
<< "\"" << std::endl;
*this->GetFolderBuildStreams()
<< " -L\"" << GetAbsBuildFilePath(tg) << "\"" << std::endl;
}
// library targets
cmTarget::LinkLibraryVectorType llv =
@ -349,8 +349,8 @@ void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries(
if (NULL != tg) {
libName = tg->GetName() + ".a";
}
*this->GetFolderBuildStreams() << " -l\"" << libName << "\""
<< std::endl;
*this->GetFolderBuildStreams()
<< " -l\"" << libName << "\"" << std::endl;
}
if (!this->TargetGroup) {

View File

@ -46,11 +46,14 @@ public:
bool AllowDeleteOnError() const override { return false; }
protected:
void GenerateBuildCommand(
std::vector<std::string>& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& projectDir,
const std::string& targetName, const std::string& config, bool fast,
int jobs, bool verbose, std::vector<std::string> const& makeOptions =
void GenerateBuildCommand(std::vector<std::string>& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
const std::string& targetName,
const std::string& config, bool fast, int jobs,
bool verbose,
std::vector<std::string> const& makeOptions =
std::vector<std::string>()) override;
void PrintBuildCommandAdvice(std::ostream& os, int jobs) const override;

View File

@ -442,7 +442,8 @@ void cmGlobalGenerator::EnableLanguage(
for (std::string const& li : cur_languages) {
if (!this->LanguagesInProgress.insert(li).second) {
std::ostringstream e;
e << "Language '" << li << "' is currently being enabled. "
e << "Language '" << li
<< "' is currently being enabled. "
"Recursive call not allowed.";
mf->IssueMessage(cmake::FATAL_ERROR, e.str());
cmSystemTools::SetFatalErrorOccured();
@ -1403,7 +1404,8 @@ void cmGlobalGenerator::Generate()
}
this->LocalGenerators[i]->GenerateTestFiles();
this->CMakeInstance->UpdateProgress(
"Generating", (static_cast<float>(i) + 1.0f) /
"Generating",
(static_cast<float>(i) + 1.0f) /
static_cast<float>(this->LocalGenerators.size()));
}
this->SetCurrentMakefile(nullptr);
@ -1560,8 +1562,8 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
cmBacktraceRange::const_iterator btIt =
noconfig_compile_definitions_bts.begin();
for (cmStringRange::const_iterator
it = noconfig_compile_definitions.begin();
for (cmStringRange::const_iterator it =
noconfig_compile_definitions.begin();
it != noconfig_compile_definitions.end(); ++it, ++btIt) {
t->InsertCompileDefinition(*it, *btIt);
}
@ -1721,7 +1723,8 @@ void cmGlobalGenerator::CheckTargetProperties()
}
}
this->CMakeInstance->UpdateProgress(
"Configuring", 0.9f +
"Configuring",
0.9f +
0.1f * (static_cast<float>(i) + 1.0f) /
static_cast<float>(this->Makefiles.size()));
}
@ -2466,7 +2469,8 @@ void cmGlobalGenerator::AddGlobalTarget_Install(
bool skipInstallRules = mf->IsOn("CMAKE_SKIP_INSTALL_RULES");
if (this->InstallTargetEnabled && skipInstallRules) {
this->CMakeInstance->IssueMessage(
cmake::WARNING, "CMAKE_SKIP_INSTALL_RULES was enabled even though "
cmake::WARNING,
"CMAKE_SKIP_INSTALL_RULES was enabled even though "
"installation rules have been specified",
mf->GetBacktrace());
} else if (this->InstallTargetEnabled && !skipInstallRules) {

View File

@ -158,12 +158,13 @@ public:
* empty then all is assumed. clean indicates if a "make clean" should be
* done first.
*/
int Build(int jobs, const std::string& srcdir, const std::string& bindir,
int Build(
int jobs, const std::string& srcdir, const std::string& bindir,
const std::string& projectName, const std::string& targetName,
std::string& output, const std::string& makeProgram,
const std::string& config, bool clean, bool fast, bool verbose,
cmDuration timeout, cmSystemTools::OutputOption outputflag =
cmSystemTools::OUTPUT_NONE,
cmDuration timeout,
cmSystemTools::OutputOption outputflag = cmSystemTools::OUTPUT_NONE,
std::vector<std::string> const& nativeOptions =
std::vector<std::string>());

View File

@ -313,8 +313,8 @@ void cmGlobalGhsMultiGenerator::WriteMacros()
void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives()
{
*this->GetBuildFileStream() << "primaryTarget=arm_integrity.tgt"
<< std::endl;
*this->GetBuildFileStream()
<< "primaryTarget=arm_integrity.tgt" << std::endl;
char const* const customization =
this->GetCMakeInstance()->GetCacheDefinition("GHS_CUSTOMIZATION");
if (NULL != customization && strlen(customization) > 0) {
@ -326,8 +326,8 @@ void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives()
void cmGlobalGhsMultiGenerator::WriteCompilerOptions(std::string const& fOSDir)
{
*this->GetBuildFileStream() << " -os_dir=\"" << fOSDir << "\""
<< std::endl;
*this->GetBuildFileStream()
<< " -os_dir=\"" << fOSDir << "\"" << std::endl;
}
void cmGlobalGhsMultiGenerator::WriteDisclaimer(std::ostream* os)

View File

@ -40,11 +40,14 @@ public:
bool optional) override;
protected:
void GenerateBuildCommand(
std::vector<std::string>& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& projectDir,
const std::string& targetName, const std::string& config, bool fast,
int jobs, bool verbose, std::vector<std::string> const& makeOptions =
void GenerateBuildCommand(std::vector<std::string>& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
const std::string& targetName,
const std::string& config, bool fast, int jobs,
bool verbose,
std::vector<std::string> const& makeOptions =
std::vector<std::string>()) override;
private:

View File

@ -45,11 +45,14 @@ public:
bool optional) override;
protected:
void GenerateBuildCommand(
std::vector<std::string>& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& projectDir,
const std::string& targetName, const std::string& config, bool fast,
int jobs, bool verbose, std::vector<std::string> const& makeOptions =
void GenerateBuildCommand(std::vector<std::string>& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
const std::string& targetName,
const std::string& config, bool fast, int jobs,
bool verbose,
std::vector<std::string> const& makeOptions =
std::vector<std::string>()) override;
void PrintBuildCommandAdvice(std::ostream& os, int jobs) const override;

View File

@ -555,8 +555,9 @@ bool cmGlobalNinjaGenerator::FindMakeProgram(cmMakefile* mf)
if (!cmSystemTools::RunSingleCommand(command, &version, &error, nullptr,
nullptr,
cmSystemTools::OUTPUT_NONE)) {
mf->IssueMessage(cmake::FATAL_ERROR, "Running\n '" +
cmJoin(command, "' '") + "'\n"
mf->IssueMessage(cmake::FATAL_ERROR,
"Running\n '" + cmJoin(command, "' '") +
"'\n"
"failed with:\n " +
error);
cmSystemTools::SetFatalErrorOccured();

View File

@ -202,11 +202,14 @@ public:
void EnableLanguage(std::vector<std::string> const& languages,
cmMakefile* mf, bool optional) override;
void GenerateBuildCommand(
std::vector<std::string>& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& projectDir,
const std::string& targetName, const std::string& config, bool fast,
int jobs, bool verbose, std::vector<std::string> const& makeOptions =
void GenerateBuildCommand(std::vector<std::string>& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
const std::string& targetName,
const std::string& config, bool fast, int jobs,
bool verbose,
std::vector<std::string> const& makeOptions =
std::vector<std::string>()) override;
// Setup target names

View File

@ -640,7 +640,8 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
for (cmGeneratorTarget* gtarget : targets) {
int type = gtarget->GetType();
std::string name = gtarget->GetName();
if (!name.empty() && ((type == cmStateEnums::EXECUTABLE) ||
if (!name.empty() &&
((type == cmStateEnums::EXECUTABLE) ||
(type == cmStateEnums::STATIC_LIBRARY) ||
(type == cmStateEnums::SHARED_LIBRARY) ||
(type == cmStateEnums::MODULE_LIBRARY) ||
@ -920,7 +921,8 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule(
std::string path;
std::vector<std::string> no_depends;
std::vector<std::string> commands;
lg->AppendEcho(commands, "The following are some of the valid targets "
lg->AppendEcho(commands,
"The following are some of the valid targets "
"for this Makefile:");
lg->AppendEcho(commands, "... all (the default if no target is provided)");
lg->AppendEcho(commands, "... clean");

Some files were not shown because too many files have changed in this diff Show More