Commit af8a1643 authored by Stephen Kelly's avatar Stephen Kelly

Remove c_str calls when using stream APIs.

Use an ad-hoc clang tool for matching the calls which should be
ported.
parent 21c573f6
......@@ -444,13 +444,13 @@ int cmCPackDebGenerator::createDeb()
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
tmpFile += "/Deb.log";
cmGeneratedFileStream ofs(tmpFile.c_str());
ofs << "# Run command: " << cmd.c_str() << std::endl
ofs << "# Run command: " << cmd << std::endl
<< "# Working directory: " << toplevel << std::endl
<< "# Output:" << std::endl
<< output.c_str() << std::endl;
<< output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running tar command: "
<< cmd.c_str() << std::endl
<< "Please check " << tmpFile.c_str() << " for errors" << std::endl);
<< cmd << std::endl
<< "Please check " << tmpFile << " for errors" << std::endl);
return 0;
}
......@@ -528,13 +528,13 @@ int cmCPackDebGenerator::createDeb()
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
tmpFile += "/Deb.log";
cmGeneratedFileStream ofs(tmpFile.c_str());
ofs << "# Run command: " << cmd.c_str() << std::endl
ofs << "# Run command: " << cmd << std::endl
<< "# Working directory: " << toplevel << std::endl
<< "# Output:" << std::endl
<< output.c_str() << std::endl;
<< output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running tar command: "
<< cmd.c_str() << std::endl
<< "Please check " << tmpFile.c_str() << " for errors" << std::endl);
<< cmd << std::endl
<< "Please check " << tmpFile << " for errors" << std::endl);
return 0;
}
......
......@@ -285,7 +285,7 @@ int cmCPackGenerator::InstallProjectViaInstallCommands(
it != installCommandsVector.end();
++it )
{
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << it->c_str()
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << *it
<< std::endl);
std::string output;
int retVal = 1;
......@@ -296,12 +296,12 @@ int cmCPackGenerator::InstallProjectViaInstallCommands(
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
tmpFile += "/InstallOutput.log";
cmGeneratedFileStream ofs(tmpFile.c_str());
ofs << "# Run command: " << it->c_str() << std::endl
ofs << "# Run command: " << *it << std::endl
<< "# Output:" << std::endl
<< output.c_str() << std::endl;
<< output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem running install command: " << it->c_str() << std::endl
<< "Please check " << tmpFile.c_str() << " for errors"
"Problem running install command: " << *it << std::endl
<< "Please check " << tmpFile << " for errors"
<< std::endl);
return 0;
}
......@@ -329,7 +329,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
++it )
{
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Create ignore files regex for: " << it->c_str() << std::endl);
"Create ignore files regex for: " << *it << std::endl);
ignoreFilesRegex.push_back(it->c_str());
}
}
......@@ -385,7 +385,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
if ( regIt->find(inFile.c_str()) )
{
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Ignore file: "
<< inFile.c_str() << std::endl);
<< inFile << std::endl);
skip = true;
}
}
......@@ -397,7 +397,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
filePath += "/" + subdir + "/"
+ cmSystemTools::RelativePath(top.c_str(), gfit->c_str());
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Copy file: "
<< inFile.c_str() << " -> " << filePath.c_str() << std::endl);
<< inFile << " -> " << filePath << std::endl);
/* If the file is a symlink we will have to re-create it */
if ( cmSystemTools::FileIsSymlink(inFile.c_str()))
{
......@@ -416,7 +416,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
) )
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying file: "
<< inFile.c_str() << " -> " << filePath.c_str() << std::endl);
<< inFile << " -> " << filePath << std::endl);
return 0;
}
}
......@@ -663,14 +663,14 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
tmpFile += "/PreinstallOutput.log";
cmGeneratedFileStream ofs(tmpFile.c_str());
ofs << "# Run command: " << buildCommandStr.c_str() << std::endl
<< "# Directory: " << installDirectory.c_str() << std::endl
ofs << "# Run command: " << buildCommandStr << std::endl
<< "# Directory: " << installDirectory << std::endl
<< "# Output:" << std::endl
<< output.c_str() << std::endl;
<< output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem running install command: " << buildCommandStr.c_str()
"Problem running install command: " << buildCommandStr
<< std::endl
<< "Please check " << tmpFile.c_str() << " for errors"
<< "Please check " << tmpFile << " for errors"
<< std::endl);
return 0;
}
......@@ -1001,7 +1001,7 @@ void cmCPackGenerator::SetOption(const std::string& op, const char* value)
int cmCPackGenerator::DoPackage()
{
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"Create package using " << this->Name.c_str() << std::endl);
"Create package using " << this->Name << std::endl);
// Prepare CPack internal name and check
// values for many CPACK_xxx vars
......@@ -1269,7 +1269,7 @@ std::string cmCPackGenerator::FindTemplate(const char* name)
<< (name ? name : "(NULL)") << std::endl);
std::string ffile = this->MakefileMap->GetModulesFile(name);
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Found template: "
<< ffile.c_str() << std::endl);
<< ffile << std::endl);
return ffile;
}
......
......@@ -169,27 +169,27 @@ void cmCPackLog::Log(int tag, const char* file, int line,
{
if ( error && !this->ErrorPrefix.empty() )
{
*this->DefaultError << this->ErrorPrefix.c_str();
*this->DefaultError << this->ErrorPrefix;
}
else if ( warning && !this->WarningPrefix.empty() )
{
*this->DefaultError << this->WarningPrefix.c_str();
*this->DefaultError << this->WarningPrefix;
}
else if ( output && !this->OutputPrefix.empty() )
{
*this->DefaultOutput << this->OutputPrefix.c_str();
*this->DefaultOutput << this->OutputPrefix;
}
else if ( verbose && !this->VerbosePrefix.empty() )
{
*this->DefaultOutput << this->VerbosePrefix.c_str();
*this->DefaultOutput << this->VerbosePrefix;
}
else if ( debug && !this->DebugPrefix.empty() )
{
*this->DefaultOutput << this->DebugPrefix.c_str();
*this->DefaultOutput << this->DebugPrefix;
}
else if ( !this->Prefix.empty() )
{
*this->DefaultOutput << this->Prefix.c_str();
*this->DefaultOutput << this->Prefix;
}
if ( useFileAndLine )
{
......
......@@ -83,10 +83,10 @@ int cmCPackNSISGenerator::PackageFiles()
fileN = fileN.substr(fileN.find('/')+1, std::string::npos);
}
cmSystemTools::ReplaceString(fileN, "/", "\\");
str << " Delete \"$INSTDIR\\" << fileN.c_str() << "\"" << std::endl;
str << " Delete \"$INSTDIR\\" << fileN << "\"" << std::endl;
}
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Uninstall Files: "
<< str.str().c_str() << std::endl);
<< 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,14 +117,14 @@ int cmCPackNSISGenerator::PackageFiles()
}
}
cmSystemTools::ReplaceString(fileN, "/", "\\");
dstr << " RMDir \"$INSTDIR\\" << fileN.c_str() << "\"" << std::endl;
dstr << " RMDir \"$INSTDIR\\" << fileN << "\"" << std::endl;
if (!componentName.empty())
{
this->Components[componentName].Directories.push_back(fileN);
}
}
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Uninstall Dirs: "
<< dstr.str().c_str() << std::endl);
<< dstr.str() << std::endl);
this->SetOptionIfNotSet("CPACK_NSIS_DELETE_DIRECTORIES",
dstr.str().c_str());
......@@ -320,7 +320,7 @@ int cmCPackNSISGenerator::PackageFiles()
std::string nsisCmd = "\"";
nsisCmd += this->GetOption("CPACK_INSTALLER_PROGRAM");
nsisCmd += "\" \"" + nsisFileName + "\"";
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << nsisCmd.c_str()
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << nsisCmd
<< std::endl);
std::string output;
int retVal = 1;
......@@ -329,12 +329,12 @@ int cmCPackNSISGenerator::PackageFiles()
if ( !res || retVal )
{
cmGeneratedFileStream ofs(tmpFile.c_str());
ofs << "# Run command: " << nsisCmd.c_str() << std::endl
ofs << "# Run command: " << nsisCmd << std::endl
<< "# Output:" << std::endl
<< output.c_str() << std::endl;
<< output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running NSIS command: "
<< nsisCmd.c_str() << std::endl
<< "Please check " << tmpFile.c_str() << " for errors" << std::endl);
<< nsisCmd << std::endl
<< "Please check " << tmpFile << " for errors" << std::endl);
return 0;
}
return 1;
......@@ -427,7 +427,7 @@ int cmCPackNSISGenerator::InitializeInternal()
std::string nsisCmd = "\"" + nsisPath + "\" " NSIS_OPT "VERSION";
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Test NSIS version: "
<< nsisCmd.c_str() << std::endl);
<< nsisCmd << std::endl);
std::string output;
int retVal = 1;
bool resS = cmSystemTools::RunSingleCommand(nsisCmd.c_str(),
......@@ -442,13 +442,13 @@ int cmCPackNSISGenerator::InitializeInternal()
std::string tmpFile = topDir ? topDir : ".";
tmpFile += "/NSISOutput.log";
cmGeneratedFileStream ofs(tmpFile.c_str());
ofs << "# Run command: " << nsisCmd.c_str() << std::endl
ofs << "# Run command: " << nsisCmd << std::endl
<< "# Output:" << std::endl
<< output.c_str() << std::endl;
<< output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem checking NSIS version with command: "
<< nsisCmd.c_str() << std::endl
<< "Please check " << tmpFile.c_str() << " for errors" << std::endl);
<< nsisCmd << std::endl
<< "Please check " << tmpFile << " for errors" << std::endl);
return 0;
}
if ( versionRex.find(output))
......@@ -470,7 +470,7 @@ int cmCPackNSISGenerator::InitializeInternal()
{
// No version check for NSIS cvs build
cmCPackLogger(cmCPackLog::LOG_DEBUG, "NSIS Version: CVS "
<< versionRexCVS.match(1).c_str() << std::endl);
<< versionRexCVS.match(1) << std::endl);
}
this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", nsisPath.c_str());
this->SetOptionIfNotSet("CPACK_NSIS_EXECUTABLES_DIRECTORY", "bin");
......@@ -844,12 +844,12 @@ CreateComponentDescription(cmCPackComponent *component,
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
tmpFile += "/CompressZip.log";
cmGeneratedFileStream ofs(tmpFile.c_str());
ofs << "# Run command: " << cmd.c_str() << std::endl
ofs << "# Run command: " << cmd << std::endl
<< "# Output:" << std::endl
<< output.c_str() << std::endl;
<< output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running zip command: "
<< cmd.c_str() << std::endl
<< "Please check " << tmpFile.c_str() << " for errors" << std::endl);
<< cmd << std::endl
<< "Please check " << tmpFile << " for errors" << std::endl);
return "";
}
......@@ -891,7 +891,7 @@ CreateComponentDescription(cmCPackComponent *component,
path = *pathIt;
cmSystemTools::ReplaceString(path, "/", "\\");
macrosOut << " Delete \"$INSTDIR\\"
<< path.c_str()
<< path
<< "\"\n";
}
for (pathIt = component->Directories.begin();
......@@ -901,7 +901,7 @@ CreateComponentDescription(cmCPackComponent *component,
path = *pathIt;
cmSystemTools::ReplaceString(path, "/", "\\");
macrosOut << " RMDir \"$INSTDIR\\"
<< path.c_str()
<< path
<< "\"\n";
}
macrosOut << " noremove_" << component->Name << ":\n";
......
......@@ -43,7 +43,7 @@ int cmCPackSTGZGenerator::InitializeInternal()
if ( inFile.empty() )
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find template file: "
<< inFile.c_str() << std::endl);
<< inFile << std::endl);
return 0;
}
this->SetOptionIfNotSet("CPACK_STGZ_HEADER_FILE", inFile.c_str());
......@@ -134,6 +134,6 @@ int cmCPackSTGZGenerator::GenerateHeader(std::ostream* os)
cmSystemTools::ReplaceString(res, headerLengthTag, buffer);
// Write in file
*os << res.c_str();
*os << res;
return this->Superclass::GenerateHeader(os);
}
......@@ -91,7 +91,7 @@ int cpackDefinitionArgument(const char* argument, const char* cValue,
value = value.c_str() + pos + 1;
def->Map[key] = value;
cmCPack_Log(def->Log, cmCPackLog::LOG_DEBUG, "Set CPack variable: "
<< key.c_str() << " to \"" << value.c_str() << "\"" << std::endl);
<< key << " to \"" << value << "\"" << std::endl);
return 1;
}
......@@ -195,7 +195,7 @@ int main (int argc, char const* const* argv)
}
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE,
"Read CPack config file: " << cpackConfigFile.c_str() << std::endl);
"Read CPack config file: " << cpackConfigFile << std::endl);
cmake cminst;
cminst.RemoveUnscriptableCommands();
......@@ -262,20 +262,20 @@ int main (int argc, char const* const* argv)
cpackConfigFile =
cmSystemTools::CollapseFullPath(cpackConfigFile.c_str());
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE,
"Read CPack configuration file: " << cpackConfigFile.c_str()
"Read CPack configuration file: " << cpackConfigFile
<< std::endl);
if ( !globalMF->ReadListFile(0, cpackConfigFile.c_str()) )
{
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
"Problem reading CPack config file: \""
<< cpackConfigFile.c_str() << "\"" << std::endl);
<< cpackConfigFile << "\"" << std::endl);
return 1;
}
}
else if ( cpackConfigFileSpecified )
{
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
"Cannot find CPack config file: \"" << cpackConfigFile.c_str()
"Cannot find CPack config file: \"" << cpackConfigFile
<< "\"" << std::endl);
return 1;
}
......
......@@ -134,7 +134,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
cmakeBuildAdditionalFlags ? cmakeBuildAdditionalFlags : "", true);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"SetMakeCommand:"
<< buildCommand.c_str() << "\n");
<< buildCommand << "\n");
this->CTest->SetCTestConfiguration("MakeCommand", buildCommand.c_str());
}
else
......
......@@ -409,7 +409,7 @@ int cmCTestBuildHandler::ProcessHandler()
for ( it = strings.begin(); it != strings.end(); ++it ) \
{ \
cmCTestLog(this->CTest, DEBUG, "Add " #strings ": " \
<< it->c_str() << std::endl); \
<< *it << std::endl); \
regexes.push_back(it->c_str()); \
}
cmCTestBuildHandlerPopulateRegexVector(
......
......@@ -76,7 +76,7 @@ int cmCTestConfigureHandler::ProcessHandler()
cmGeneratedFileStream ofs;
this->StartLogFile("Configure", ofs);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Configure with command: "
<< cCommand.c_str() << std::endl);
<< cCommand << std::endl);
res = this->CTest->RunMakeCommand(cCommand.c_str(), &output,
&retVal, buildDirectory.c_str(),
0, ofs);
......@@ -99,7 +99,7 @@ int cmCTestConfigureHandler::ProcessHandler()
{
os << retVal;
}
os << "<ConfigureCommand>" << cCommand.c_str() << "</ConfigureCommand>"
os << "<ConfigureCommand>" << cCommand << "</ConfigureCommand>"
<< std::endl;
cmCTestLog(this->CTest, DEBUG, "End" << std::endl);
os << "<Log>" << cmXMLSafe(output) << "</Log>" << std::endl;
......
This diff is collapsed.
......@@ -25,7 +25,7 @@ bool cmCTestEmptyBinaryDirectoryCommand
if ( !cmCTestScriptHandler::EmptyBinaryDirectory(args[0].c_str()) )
{
cmOStringStream ostr;
ostr << "problem removing the binary directory: " << args[0].c_str();
ostr << "problem removing the binary directory: " << args[0];
this->SetError(ostr.str());
return false;
}
......
......@@ -124,7 +124,7 @@ bool cmCTestGenericHandler::StartResultingXML(cmCTest::Part part,
ostr.str(), xofs, true) )
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot create resulting XML file: " << ostr.str().c_str()
"Cannot create resulting XML file: " << ostr.str()
<< std::endl);
return false;
}
......@@ -156,7 +156,7 @@ bool cmCTestGenericHandler::StartLogFile(const char* name,
if( !this->CTest->OpenOutputFile("Temporary", ostr.str(), xofs) )
{
cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot create log file: "
<< ostr.str().c_str() << std::endl);
<< ostr.str() << std::endl);
return false;
}
return true;
......
......@@ -514,7 +514,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot find memory checker suppression file: "
<< this->CTest->GetCTestConfiguration(
"MemoryCheckSuppressionFile").c_str() << std::endl);
"MemoryCheckSuppressionFile") << std::endl);
return false;
}
std::string suppressions = "--suppressions="
......@@ -569,7 +569,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
}
default:
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Do not understand memory checker: " << this->MemoryTester.c_str()
"Do not understand memory checker: " << this->MemoryTester
<< std::endl);
return false;
}
......@@ -885,7 +885,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput(
else if(!parser.ParseChunk(theLine.c_str(), theLine.size()))
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Error in ParseChunk: " << theLine.c_str()
"Error in ParseChunk: " << theLine
<< std::endl);
}
}
......@@ -916,7 +916,7 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res,
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"PostProcessBoundsCheckerTest for : "
<< res.Name.c_str() << std::endl);
<< res.Name << std::endl);
std::string ofile = testOutputFileName(test);
if ( ofile.empty() )
{
......@@ -943,10 +943,10 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res,
cmSystemTools::Delay(1000);
cmSystemTools::RemoveFile(this->BoundsCheckerDPBDFile.c_str());
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Remove: "
<< this->BoundsCheckerDPBDFile.c_str() << std::endl);
<< this->BoundsCheckerDPBDFile << std::endl);
cmSystemTools::RemoveFile(this->BoundsCheckerXMLFile.c_str());
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Remove: "
<< this->BoundsCheckerXMLFile.c_str() << std::endl);
<< this->BoundsCheckerXMLFile << std::endl);
}
void
......@@ -955,7 +955,7 @@ cmCTestMemCheckHandler::PostProcessPurifyTest(cmCTestTestResult& res,
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"PostProcessPurifyTest for : "
<< res.Name.c_str() << std::endl);
<< res.Name << std::endl);
appendMemTesterOutput(res, test);
}
......@@ -965,7 +965,7 @@ cmCTestMemCheckHandler::PostProcessValgrindTest(cmCTestTestResult& res,
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"PostProcessValgrindTest for : "
<< res.Name.c_str() << std::endl);
<< res.Name << std::endl);
appendMemTesterOutput(res, test);
}
......
......@@ -672,7 +672,7 @@ void cmCTestMultiProcessHandler::PrintTestList()
indexStr << " #" << p.Index << ":";
cmCTestLog(this->CTest, HANDLER_OUTPUT,
std::setw(3 + getNumWidth(this->TestHandler->GetMaxIndex()))
<< indexStr.str().c_str());
<< indexStr.str());
cmCTestLog(this->CTest, HANDLER_OUTPUT, " ");
cmCTestLog(this->CTest, HANDLER_OUTPUT, p.Name.c_str() << std::endl);
//pop working dir
......
......@@ -334,9 +334,9 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
*this->TestHandler->LogFile << "Test Failed.\n";
}
}
*this->TestHandler->LogFile << "\"" << this->TestProperties->Name.c_str()
*this->TestHandler->LogFile << "\"" << this->TestProperties->Name
<< "\" end time: " << this->CTest->CurrentTime() << std::endl
<< "\"" << this->TestProperties->Name.c_str() << "\" time elapsed: "
<< "\"" << this->TestProperties->Name << "\" time elapsed: "
<< buffer << std::endl
<< "----------------------------------------------------------"
<< std::endl << std::endl;
......@@ -388,8 +388,8 @@ void cmCTestRunTest::MemCheckPostProcess()
}
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index
<< ": process test output now: "
<< this->TestProperties->Name.c_str() << " "
<< this->TestResult.Name.c_str() << std::endl);
<< this->TestProperties->Name << " "
<< this->TestResult.Name << std::endl);
cmCTestMemCheckHandler * handler = static_cast<cmCTestMemCheckHandler*>
(this->TestHandler);
switch ( handler->MemoryTesterStyle )
......@@ -465,9 +465,9 @@ bool cmCTestRunTest::StartTest(size_t total)
//Required file was not found
this->TestProcess = new cmProcess;
*this->TestHandler->LogFile << "Unable to find required file: "
<< file.c_str() << std::endl;
<< file << std::endl;
cmCTestLog(this->CTest, ERROR_MESSAGE, "Unable to find required file: "
<< file.c_str() << std::endl);
<< file << std::endl);
this->TestResult.Output = "Unable to find required file: " + file;
this->TestResult.FullCommandLine = "";
this->TestResult.CompletionStatus = "Not Run";
......@@ -482,9 +482,9 @@ bool cmCTestRunTest::StartTest(size_t total)
// that has that information
this->TestProcess = new cmProcess;
*this->TestHandler->LogFile << "Unable to find executable: "
<< args[1].c_str() << std::endl;
<< args[1] << std::endl;
cmCTestLog(this->CTest, ERROR_MESSAGE, "Unable to find executable: "
<< args[1].c_str() << std::endl);
<< args[1] << std::endl);
this->TestResult.Output = "Unable to find executable: " + args[1];
this->TestResult.FullCommandLine = "";
this->TestResult.CompletionStatus = "Not Run";
......@@ -711,7 +711,7 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total)
indexStr << " #" << this->Index << ":";
cmCTestLog(this->CTest, HANDLER_OUTPUT,
std::setw(3 + getNumWidth(this->TestHandler->GetMaxIndex()))
<< indexStr.str().c_str());
<< indexStr.str());
cmCTestLog(this->CTest, HANDLER_OUTPUT, " ");
const int maxTestNameWidth = this->CTest->GetMaxTestNameWidth();
std::string outname = this->TestProperties->Name + " ";
......@@ -722,18 +722,18 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total)
<< this->TestProperties->Name << std::endl;
*this->TestHandler->LogFile << this->TestProperties->Index << "/"
<< this->TestHandler->TotalNumberOfTests
<< " Test: " << this->TestProperties->Name.c_str() << std::endl;
<< " Test: " << this->TestProperties->Name << std::endl;
*this->TestHandler->LogFile << "Command: \"" << this->ActualCommand << "\"";
for (std::vector<std::string>::iterator i = this->Arguments.begin();
i != this->Arguments.end(); ++i)
{
*this->TestHandler->LogFile
<< " \"" << i->c_str() << "\"";
<< " \"" << *i << "\"";
}
*this->TestHandler->LogFile << std::endl
<< "Directory: " << this->TestProperties->Directory << std::endl
<< "\"" << this->TestProperties->Name.c_str() << "\" start time: "
<< "\"" << this->TestProperties->Name << "\" start time: "
<< this->StartTime << std::endl;
*this->TestHandler->LogFile
......@@ -741,9 +741,9 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total)
<< "----------------------------------------------------------"
<< std::endl;
*this->TestHandler->LogFile
<< this->ProcessOutput.c_str() << "<end of output>" << std::endl;
<< this->ProcessOutput << "<end of output>" << std::endl;
cmCTestLog(this->CTest, HANDLER_OUTPUT, outname.c_str());
cmCTestLog(this->CTest, DEBUG, "Testing "
<< this->TestProperties->Name.c_str() << " ... ");
<< this->TestProperties->Name << " ... ");
}
......@@ -426,7 +426,7 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
cmSystemTools::GetErrorOccuredFlag())
{
cmCTestLog(this->CTest, ERROR_MESSAGE, "Error in read:"
<< systemFile.c_str() << "\n");
<< systemFile << "\n");
return 2;
}
......@@ -444,7 +444,7 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
cmSystemTools::GetErrorOccuredFlag())
{
cmCTestLog(this->CTest, ERROR_MESSAGE, "Error in read script: "
<< script.c_str()
<< script
<< std::endl);
// Reset the error flag so that it can run more than
// one script with an error when you
......@@ -781,7 +781,7 @@ int cmCTestScriptHandler::PerformExtraUpdates()
output = "";
retVal = 0;
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run Update: "
<< fullCommand.c_str() << std::endl);
<< fullCommand << std::endl);
res = cmSystemTools::RunSingleCommand(fullCommand.c_str(), &output,
&retVal, cvsArgs[0].c_str(),
this->HandlerVerbose, 0 /*this->TimeOut*/);
......@@ -902,7 +902,7 @@ int cmCTestScriptHandler::RunConfigurationDashboard()
command += "\"";
retVal = 0;
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run cmake command: "
<< command.c_str() << std::endl);
<< command << std::endl);
res = cmSystemTools::RunSingleCommand(command.c_str(), &output,
&retVal, this->BinaryDir.c_str(),
this->HandlerVerbose, 0 /*this->TimeOut*/);
......@@ -916,7 +916,7 @@ int cmCTestScriptHandler::RunConfigurationDashboard()
}
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Write CMake output to file: " << cmakeOutputFile.c_str()
"Write CMake output to file: " << cmakeOutputFile
<< std::endl);
cmGeneratedFileStream fout(cmakeOutputFile.c_str());
if ( fout )
......@@ -927,7 +927,7 @@ int cmCTestScriptHandler::RunConfigurationDashboard()
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot open CMake output file: "
<< cmakeOutputFile.c_str() << " for writing" << std::endl);
<< cmakeOutputFile << " for writing" << std::endl);
}
}
if (!res || retVal != 0)
......@@ -948,7 +948,7 @@ int cmCTestScriptHandler::RunConfigurationDashboard()
output = "";
retVal = 0;
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run ctest command: "
<< command.c_str() << std::endl);
<< command << std::endl);
res = cmSystemTools::RunSingleCommand(command.c_str(), &output,
&retVal, this->BinaryDir.c_str(), this->HandlerVerbose,
0 /*this->TimeOut*/);
......@@ -962,13 +962,13 @@ int cmCTestScriptHandler::RunConfigurationDashboard()
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Unable to run cmake:" << std::endl
<< cmakeFailedOuput.c_str() << std::endl);
<< cmakeFailedOuput << std::endl);
return 10;
}
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Unable to run ctest:" << std::endl
<< "command: " << command.c_str() << std::endl
<< "output: " << output.c_str() << std::endl);
<< "command: " << command << std::endl
<< "output: " << output << std::endl);
if (!res)
{
return 11;
......
......@@ -229,18 +229,18 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
if ( ::stat(local_file.c_str(), &st) )
{
cmCTestLog(this->CTest, ERROR_MESSAGE, " Cannot find file: "
<< local_file.c_str() << std::endl);
<< local_file << std::endl);
::curl_easy_cleanup(curl);
::curl_global_cleanup();
return false;
}
ftpfile = cmsys::SystemTools::Fopen(local_file.c_str(), "rb");
*this->LogFile << "\tUpload file: " << local_file.c_str() << " to "
<< upload_as.c_str() << std::endl;
*this->LogFile << "\tUpload file: " << local_file << " to "
<< upload_as << std::endl;
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Upload file: "
<< local_file.c_str() << " to "
<< upload_as.c_str() << std::endl);
<< local_file << " to "
<< upload_as << std::endl);