diff options
Diffstat (limited to 'Source/CTest')
51 files changed, 299 insertions, 313 deletions
diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx index 381c70ce5d..3014a9322f 100644 --- a/Source/CTest/cmCTestBZR.cxx +++ b/Source/CTest/cmCTestBZR.cxx @@ -225,35 +225,35 @@ private: return true; } - virtual void StartElement(const char* name, const char**) + virtual void StartElement(const std::string& name, const char**) { this->CData.clear(); - if(strcmp(name, "log") == 0) + if(name == "log") { this->Rev = Revision(); this->Changes.clear(); } // affected-files can contain blocks of // modified, unknown, renamed, kind-changed, removed, conflicts, added - else if(strcmp(name, "modified") == 0 - || strcmp(name, "renamed") == 0 - || strcmp(name, "kind-changed") == 0) + else if(name == "modified" + || name == "renamed" + || name == "kind-changed") { this->CurChange = Change(); this->CurChange.Action = 'M'; } - else if(strcmp(name, "added") == 0) + else if(name == "added") { this->CurChange = Change(); this->CurChange = 'A'; } - else if(strcmp(name, "removed") == 0) + else if(name == "removed") { this->CurChange = Change(); this->CurChange = 'D'; } - else if(strcmp(name, "unknown") == 0 - || strcmp(name, "conflicts") == 0) + else if(name == "unknown" + || name == "conflicts") { // Should not happen here this->CurChange = Change(); @@ -265,27 +265,27 @@ private: this->CData.insert(this->CData.end(), data, data+length); } - virtual void EndElement(const char* name) + virtual void EndElement(const std::string& name) { - if(strcmp(name, "log") == 0) + if(name == "log") { this->BZR->DoRevision(this->Rev, this->Changes); } - else if((strcmp(name, "file") == 0 || strcmp(name, "directory") == 0) - && !this->CData.empty()) + else if(!this->CData.empty() && + (name == "file" || name == "directory")) { this->CurChange.Path.assign(&this->CData[0], this->CData.size()); cmSystemTools::ConvertToUnixSlashes(this->CurChange.Path); this->Changes.push_back(this->CurChange); } - else if(strcmp(name, "symlink") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "symlink") { // symlinks have an arobase at the end in the log this->CurChange.Path.assign(&this->CData[0], this->CData.size()-1); cmSystemTools::ConvertToUnixSlashes(this->CurChange.Path); this->Changes.push_back(this->CurChange); } - else if(strcmp(name, "committer") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "committer") { this->Rev.Author.assign(&this->CData[0], this->CData.size()); if(this->EmailRegex.find(this->Rev.Author)) @@ -294,15 +294,15 @@ private: this->Rev.EMail = this->EmailRegex.match(2); } } - else if(strcmp(name, "timestamp") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "timestamp") { this->Rev.Date.assign(&this->CData[0], this->CData.size()); } - else if(strcmp(name, "message") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "message") { this->Rev.Log.assign(&this->CData[0], this->CData.size()); } - else if(strcmp(name, "revno") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "revno") { this->Rev.Rev.assign(&this->CData[0], this->CData.size()); } @@ -409,7 +409,7 @@ bool cmCTestBZR::UpdateImpl() { opts = this->CTest->GetCTestConfiguration("BZRUpdateOptions"); } - std::vector<cmStdString> args = cmSystemTools::ParseArguments(opts.c_str()); + std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str()); // TODO: if(this->CTest->GetTestModel() == cmCTest::NIGHTLY) @@ -418,7 +418,7 @@ bool cmCTestBZR::UpdateImpl() bzr_update.push_back(this->CommandLineTool.c_str()); bzr_update.push_back("pull"); - for(std::vector<cmStdString>::const_iterator ai = args.begin(); + for(std::vector<std::string>::const_iterator ai = args.begin(); ai != args.end(); ++ai) { bzr_update.push_back(ai->c_str()); diff --git a/Source/CTest/cmCTestBuildAndTestHandler.h b/Source/CTest/cmCTestBuildAndTestHandler.h index ca50c64526..d1e9a4d193 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.h +++ b/Source/CTest/cmCTestBuildAndTestHandler.h @@ -54,7 +54,7 @@ protected: std::string &cmakeOutString, std::string &cwd, cmake *cm); - cmStdString Output; + std::string Output; std::string BuildGenerator; std::string BuildGeneratorToolset; diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx index 12ff71828a..04eabd20d2 100644 --- a/Source/CTest/cmCTestBuildCommand.cxx +++ b/Source/CTest/cmCTestBuildCommand.cxx @@ -101,8 +101,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler() } if ( this->GlobalGenerator ) { - if ( strcmp(this->GlobalGenerator->GetName(), - cmakeGeneratorName) != 0 ) + if ( this->GlobalGenerator->GetName() != cmakeGeneratorName ) { delete this->GlobalGenerator; this->GlobalGenerator = 0; @@ -130,8 +129,9 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler() std::string dir = this->CTest->GetCTestConfiguration("BuildDirectory"); std::string buildCommand = this->GlobalGenerator-> - GenerateCMakeBuildCommand(cmakeBuildTarget, cmakeBuildConfiguration, - cmakeBuildAdditionalFlags, true); + GenerateCMakeBuildCommand(cmakeBuildTarget ? cmakeBuildTarget : "", + cmakeBuildConfiguration, + cmakeBuildAdditionalFlags ? cmakeBuildAdditionalFlags : "", true); cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "SetMakeCommand:" << buildCommand.c_str() << "\n"); diff --git a/Source/CTest/cmCTestBuildCommand.h b/Source/CTest/cmCTestBuildCommand.h index 08887fe8e5..2632ebc472 100644 --- a/Source/CTest/cmCTestBuildCommand.h +++ b/Source/CTest/cmCTestBuildCommand.h @@ -43,7 +43,7 @@ public: /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() const { return "ctest_build";} + virtual std::string GetName() const { return "ctest_build";} virtual bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus &status); diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index c5deb964a3..291c70a6f0 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -380,7 +380,7 @@ int cmCTestBuildHandler::ProcessHandler() // Create lists of regular expression strings for errors, error exceptions, // warnings and warning exceptions. - std::vector<cmStdString>::size_type cc; + std::vector<std::string>::size_type cc; for ( cc = 0; cmCTestErrorMatches[cc]; cc ++ ) { this->CustomErrorMatches.push_back(cmCTestErrorMatches[cc]); @@ -400,7 +400,7 @@ int cmCTestBuildHandler::ProcessHandler() } // Pre-compile regular expressions objects for all regular expressions - std::vector<cmStdString>::iterator it; + std::vector<std::string>::iterator it; #define cmCTestBuildHandlerPopulateRegexVector(strings, regexes) \ regexes.clear(); \ @@ -602,7 +602,7 @@ void cmCTestBuildHandler::GenerateXMLLaunched(std::ostream& os) // Sort XML fragments in chronological order. cmFileTimeComparison ftc; FragmentCompare fragmentCompare(&ftc); - typedef std::set<cmStdString, FragmentCompare> Fragments; + typedef std::set<std::string, FragmentCompare> Fragments; Fragments fragments(fragmentCompare); // Identify fragments on disk. @@ -889,7 +889,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal, const char* dir, int timeout, std::ostream& ofs) { // First generate the command and arguments - std::vector<cmStdString> args = cmSystemTools::ParseArguments(command); + std::vector<std::string> args = cmSystemTools::ParseArguments(command); if(args.size() < 1) { @@ -897,7 +897,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, } std::vector<const char*> argv; - for(std::vector<cmStdString>::const_iterator a = args.begin(); + for(std::vector<std::string>::const_iterator a = args.begin(); a != args.end(); ++a) { argv.push_back(a->c_str()); @@ -1133,7 +1133,7 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, int length, errorwarning.PostContext = ""; // Copy pre-context to report - std::deque<cmStdString>::iterator pcit; + std::deque<std::string>::iterator pcit; for ( pcit = this->PreContext.begin(); pcit != this->PreContext.end(); ++pcit ) diff --git a/Source/CTest/cmCTestBuildHandler.h b/Source/CTest/cmCTestBuildHandler.h index ff7cfd6800..09346f9498 100644 --- a/Source/CTest/cmCTestBuildHandler.h +++ b/Source/CTest/cmCTestBuildHandler.h @@ -97,10 +97,10 @@ private: double StartBuildTime; double EndBuildTime; - std::vector<cmStdString> CustomErrorMatches; - std::vector<cmStdString> CustomErrorExceptions; - std::vector<cmStdString> CustomWarningMatches; - std::vector<cmStdString> CustomWarningExceptions; + std::vector<std::string> CustomErrorMatches; + std::vector<std::string> CustomErrorExceptions; + std::vector<std::string> CustomWarningMatches; + std::vector<std::string> CustomWarningExceptions; std::vector<std::string> ReallyCustomWarningMatches; std::vector<std::string> ReallyCustomWarningExceptions; std::vector<cmCTestCompileErrorWarningRex> ErrorWarningFileLineRegex; @@ -121,8 +121,8 @@ private: size_t BuildOutputLogSize; std::vector<char> CurrentProcessingLine; - cmStdString SimplifySourceDir; - cmStdString SimplifyBuildDir; + std::string SimplifySourceDir; + std::string SimplifyBuildDir; size_t OutputLineCounter; typedef std::vector<cmCTestBuildErrorWarning> t_ErrorsAndWarningsVector; t_ErrorsAndWarningsVector ErrorsAndWarnings; @@ -130,7 +130,7 @@ private: size_t PostContextCount; size_t MaxPreContext; size_t MaxPostContext; - std::deque<cmStdString> PreContext; + std::deque<std::string> PreContext; int TotalErrors; int TotalWarnings; diff --git a/Source/CTest/cmCTestCVS.cxx b/Source/CTest/cmCTestCVS.cxx index 17dbb55562..ab363d0164 100644 --- a/Source/CTest/cmCTestCVS.cxx +++ b/Source/CTest/cmCTestCVS.cxx @@ -99,7 +99,7 @@ bool cmCTestCVS::UpdateImpl() opts = "-dP"; } } - std::vector<cmStdString> args = cmSystemTools::ParseArguments(opts.c_str()); + std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str()); // Specify the start time for nightly testing. if(this->CTest->GetTestModel() == cmCTest::NIGHTLY) @@ -112,7 +112,7 @@ bool cmCTestCVS::UpdateImpl() cvs_update.push_back(this->CommandLineTool.c_str()); cvs_update.push_back("-z3"); cvs_update.push_back("update"); - for(std::vector<cmStdString>::const_iterator ai = args.begin(); + for(std::vector<std::string>::const_iterator ai = args.begin(); ai != args.end(); ++ai) { cvs_update.push_back(ai->c_str()); @@ -308,7 +308,7 @@ bool cmCTestCVS::WriteXMLUpdates(std::ostream& xml) " Gathering version information (one . per updated file):\n" " " << std::flush); - for(std::map<cmStdString, Directory>::const_iterator + for(std::map<std::string, Directory>::const_iterator di = this->Dirs.begin(); di != this->Dirs.end(); ++di) { this->WriteXMLDirectory(xml, di->first, di->second); diff --git a/Source/CTest/cmCTestCVS.h b/Source/CTest/cmCTestCVS.h index b7fe567d8e..64e1747d1f 100644 --- a/Source/CTest/cmCTestCVS.h +++ b/Source/CTest/cmCTestCVS.h @@ -32,8 +32,8 @@ private: virtual bool WriteXMLUpdates(std::ostream& xml); // Update status for files in each directory. - class Directory: public std::map<cmStdString, PathStatus> {}; - std::map<cmStdString, Directory> Dirs; + class Directory: public std::map<std::string, PathStatus> {}; + std::map<std::string, Directory> Dirs; std::string ComputeBranchFlag(std::string const& dir); void LoadRevisions(std::string const& file, const char* branchFlag, diff --git a/Source/CTest/cmCTestConfigureCommand.h b/Source/CTest/cmCTestConfigureCommand.h index b592c5a2ca..7941d4e3c9 100644 --- a/Source/CTest/cmCTestConfigureCommand.h +++ b/Source/CTest/cmCTestConfigureCommand.h @@ -38,7 +38,7 @@ public: /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() const { return "ctest_configure";} + virtual std::string GetName() const { return "ctest_configure";} cmTypeMacro(cmCTestConfigureCommand, cmCTestHandlerCommand); diff --git a/Source/CTest/cmCTestCoverageCommand.h b/Source/CTest/cmCTestCoverageCommand.h index 11bb4112df..5762e07318 100644 --- a/Source/CTest/cmCTestCoverageCommand.h +++ b/Source/CTest/cmCTestCoverageCommand.h @@ -39,7 +39,7 @@ public: /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() const { return "ctest_coverage";} + virtual std::string GetName() const { return "ctest_coverage";} cmTypeMacro(cmCTestCoverageCommand, cmCTestHandlerCommand); @@ -56,7 +56,7 @@ protected: }; bool LabelsMentioned; - std::set<cmStdString> Labels; + std::set<std::string> Labels; }; diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 0503d941aa..2e35b7575f 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -363,7 +363,7 @@ int cmCTestCoverageHandler::ProcessHandler() // setup the regex exclude stuff this->CustomCoverageExcludeRegex.clear(); - std::vector<cmStdString>::iterator rexIt; + std::vector<std::string>::iterator rexIt; for ( rexIt = this->CustomCoverageExclude.begin(); rexIt != this->CustomCoverageExclude.end(); ++ rexIt ) @@ -713,7 +713,7 @@ void cmCTestCoverageHandler::PopulateCustomVectors(cmMakefile *mf) this->CustomCoverageExclude); this->CTest->PopulateCustomVector(mf, "CTEST_EXTRA_COVERAGE_GLOB", this->ExtraCoverageGlobs); - std::vector<cmStdString>::iterator it; + std::vector<std::string>::iterator it; for ( it = this->CustomCoverageExclude.begin(); it != this->CustomCoverageExclude.end(); ++ it ) @@ -989,8 +989,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage( << "--------------------------------------------------------------" << std::endl); - std::vector<cmStdString> lines; - std::vector<cmStdString>::iterator line; + std::vector<std::string> lines; + std::vector<std::string>::iterator line; cmSystemTools::Split(output.c_str(), lines); @@ -1504,7 +1504,7 @@ namespace //---------------------------------------------------------------------- int cmCTestCoverageHandler::RunBullseyeCoverageBranch( cmCTestCoverageHandlerContainer* cont, - std::set<cmStdString>& coveredFileNames, + std::set<std::string>& coveredFileNames, std::vector<std::string>& files, std::vector<std::string>& filesFullPath) { @@ -1545,7 +1545,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch( outputFile.c_str() << std::endl); return 0; } - std::map<cmStdString, cmStdString> fileMap; + std::map<std::string, std::string> fileMap; std::vector<std::string>::iterator fp = filesFullPath.begin(); for(std::vector<std::string>::iterator f = files.begin(); f != files.end(); ++f, ++fp) @@ -1558,7 +1558,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch( std::string lineIn; bool valid = false; // are we in a valid output file int line = 0; // line of the current file - cmStdString file; + std::string file; while(cmSystemTools::GetLineFromStream(fin, lineIn)) { bool startFile = false; @@ -1593,7 +1593,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch( } count++; // move on one } - std::map<cmStdString, cmStdString>::iterator + std::map<std::string, std::string>::iterator i = fileMap.find(file); // if the file should be covered write out the header for that file if(i != fileMap.end()) @@ -1758,7 +1758,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary( outputFile.c_str() << std::endl); return 0; } - std::set<cmStdString> coveredFileNames; + std::set<std::string> coveredFileNames; while(cmSystemTools::GetLineFromStream(fin, stdline)) { // if we have a line of output from stdout @@ -2105,10 +2105,10 @@ void cmCTestCoverageHandler::WriteXMLLabels(std::ostream& os, //---------------------------------------------------------------------------- void -cmCTestCoverageHandler::SetLabelFilter(std::set<cmStdString> const& labels) +cmCTestCoverageHandler::SetLabelFilter(std::set<std::string> const& labels) { this->LabelFilter.clear(); - for(std::set<cmStdString>::const_iterator li = labels.begin(); + for(std::set<std::string>::const_iterator li = labels.begin(); li != labels.end(); ++li) { this->LabelFilter.insert(this->GetLabelId(*li)); @@ -2158,7 +2158,7 @@ std::set<std::string> cmCTestCoverageHandler::FindUncoveredFiles( { std::set<std::string> extraMatches; - for(std::vector<cmStdString>::iterator i = this->ExtraCoverageGlobs.begin(); + for(std::vector<std::string>::iterator i = this->ExtraCoverageGlobs.begin(); i != this->ExtraCoverageGlobs.end(); ++i) { cmsys::Glob gl; diff --git a/Source/CTest/cmCTestCoverageHandler.h b/Source/CTest/cmCTestCoverageHandler.h index 660f501b2d..6a8f55def9 100644 --- a/Source/CTest/cmCTestCoverageHandler.h +++ b/Source/CTest/cmCTestCoverageHandler.h @@ -55,7 +55,7 @@ public: void PopulateCustomVectors(cmMakefile *mf); /** Report coverage only for sources with these labels. */ - void SetLabelFilter(std::set<cmStdString> const& labels); + void SetLabelFilter(std::set<std::string> const& labels); private: bool ShouldIDoCoverage(const char* file, const char* srcDir, @@ -81,7 +81,7 @@ private: int HandleBullseyeCoverage(cmCTestCoverageHandlerContainer* cont); int RunBullseyeSourceSummary(cmCTestCoverageHandlerContainer* cont); int RunBullseyeCoverageBranch(cmCTestCoverageHandlerContainer* cont, - std::set<cmStdString>& coveredFileNames, + std::set<std::string>& coveredFileNames, std::vector<std::string>& files, std::vector<std::string>& filesFullPath); @@ -112,19 +112,19 @@ private: std::set<std::string> FindUncoveredFiles( cmCTestCoverageHandlerContainer* cont); - std::vector<cmStdString> CustomCoverageExclude; + std::vector<std::string> CustomCoverageExclude; std::vector<cmsys::RegularExpression> CustomCoverageExcludeRegex; - std::vector<cmStdString> ExtraCoverageGlobs; + std::vector<std::string> ExtraCoverageGlobs; // Map from source file to label ids. class LabelSet: public std::set<int> {}; - typedef std::map<cmStdString, LabelSet> LabelMapType; + typedef std::map<std::string, LabelSet> LabelMapType; LabelMapType SourceLabels; LabelMapType TargetDirs; // Map from label name to label id. - typedef std::map<cmStdString, int> LabelIdMapType; + typedef std::map<std::string, int> LabelIdMapType; LabelIdMapType LabelIdMap; std::vector<std::string> Labels; int GetLabelId(std::string const& label); diff --git a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h index 07e59a46ca..d182d17947 100644 --- a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h +++ b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h @@ -48,7 +48,7 @@ public: /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() const { return "ctest_empty_binary_directory";} + virtual std::string GetName() const { return "ctest_empty_binary_directory";} cmTypeMacro(cmCTestEmptyBinaryDirectoryCommand, cmCTestCommand); diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx index 0e0e797b54..aaa01b2d00 100644 --- a/Source/CTest/cmCTestGIT.cxx +++ b/Source/CTest/cmCTestGIT.cxx @@ -179,8 +179,8 @@ bool cmCTestGIT::UpdateByFetchAndReset() { opts = this->CTest->GetCTestConfiguration("GITUpdateOptions"); } - std::vector<cmStdString> args = cmSystemTools::ParseArguments(opts.c_str()); - for(std::vector<cmStdString>::const_iterator ai = args.begin(); + std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str()); + for(std::vector<std::string>::const_iterator ai = args.begin(); ai != args.end(); ++ai) { git_fetch.push_back(ai->c_str()); diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx index 5338f307b1..ae498ea446 100644 --- a/Source/CTest/cmCTestGenericHandler.cxx +++ b/Source/CTest/cmCTestGenericHandler.cxx @@ -30,12 +30,8 @@ cmCTestGenericHandler::~cmCTestGenericHandler() } //---------------------------------------------------------------------- -void cmCTestGenericHandler::SetOption(const char* op, const char* value) +void cmCTestGenericHandler::SetOption(const std::string& op, const char* value) { - if ( !op ) - { - return; - } if ( !value ) { cmCTestGenericHandler::t_StringToString::iterator remit @@ -51,14 +47,10 @@ void cmCTestGenericHandler::SetOption(const char* op, const char* value) } //---------------------------------------------------------------------- -void cmCTestGenericHandler::SetPersistentOption(const char* op, +void cmCTestGenericHandler::SetPersistentOption(const std::string& op, const char* value) { this->SetOption(op, value); - if ( !op ) - { - return; - } if ( !value ) { cmCTestGenericHandler::t_StringToString::iterator remit @@ -88,7 +80,7 @@ void cmCTestGenericHandler::Initialize() } //---------------------------------------------------------------------- -const char* cmCTestGenericHandler::GetOption(const char* op) +const char* cmCTestGenericHandler::GetOption(const std::string& op) { cmCTestGenericHandler::t_StringToString::iterator remit = this->Options.find(op); diff --git a/Source/CTest/cmCTestGenericHandler.h b/Source/CTest/cmCTestGenericHandler.h index ba8febb619..2788cba57a 100644 --- a/Source/CTest/cmCTestGenericHandler.h +++ b/Source/CTest/cmCTestGenericHandler.h @@ -71,12 +71,12 @@ public: cmCTestGenericHandler(); virtual ~cmCTestGenericHandler(); - typedef std::map<cmStdString,cmStdString> t_StringToString; + typedef std::map<std::string,std::string> t_StringToString; - void SetPersistentOption(const char* op, const char* value); - void SetOption(const char* op, const char* value); - const char* GetOption(const char* op); + void SetPersistentOption(const std::string& op, const char* value); + void SetOption(const std::string& op, const char* value); + const char* GetOption(const std::string& op); void SetCommand(cmCTestCommand* command) { diff --git a/Source/CTest/cmCTestGlobalVC.cxx b/Source/CTest/cmCTestGlobalVC.cxx index 8c51102e5b..5f570b5d31 100644 --- a/Source/CTest/cmCTestGlobalVC.cxx +++ b/Source/CTest/cmCTestGlobalVC.cxx @@ -132,7 +132,7 @@ bool cmCTestGlobalVC::WriteXMLUpdates(std::ostream& xml) this->WriteXMLGlobal(xml); - for(std::map<cmStdString, Directory>::const_iterator + for(std::map<std::string, Directory>::const_iterator di = this->Dirs.begin(); di != this->Dirs.end(); ++di) { this->WriteXMLDirectory(xml, di->first, di->second); diff --git a/Source/CTest/cmCTestGlobalVC.h b/Source/CTest/cmCTestGlobalVC.h index a648a59828..cb0d165608 100644 --- a/Source/CTest/cmCTestGlobalVC.h +++ b/Source/CTest/cmCTestGlobalVC.h @@ -39,8 +39,8 @@ protected: }; // Update status for files in each directory. - class Directory: public std::map<cmStdString, File> {}; - std::map<cmStdString, Directory> Dirs; + class Directory: public std::map<std::string, File> {}; + std::map<std::string, Directory> Dirs; // Old and new repository revisions. std::string OldRevision; diff --git a/Source/CTest/cmCTestHG.cxx b/Source/CTest/cmCTestHG.cxx index 86a7617f15..0f79d68a0b 100644 --- a/Source/CTest/cmCTestHG.cxx +++ b/Source/CTest/cmCTestHG.cxx @@ -149,8 +149,8 @@ bool cmCTestHG::UpdateImpl() { opts = this->CTest->GetCTestConfiguration("HGUpdateOptions"); } - std::vector<cmStdString> args = cmSystemTools::ParseArguments(opts.c_str()); - for(std::vector<cmStdString>::const_iterator ai = args.begin(); + std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str()); + for(std::vector<std::string>::const_iterator ai = args.begin(); ai != args.end(); ++ai) { hg_update.push_back(ai->c_str()); @@ -189,10 +189,10 @@ private: return true; } - virtual void StartElement(const char* name, const char** atts) + virtual void StartElement(const std::string& name, const char** atts) { this->CData.clear(); - if(strcmp(name, "logentry") == 0) + if(name == "logentry") { this->Rev = Revision(); if(const char* rev = this->FindAttribute(atts, "revision")) @@ -208,29 +208,29 @@ private: this->CData.insert(this->CData.end(), data, data+length); } - virtual void EndElement(const char* name) + virtual void EndElement(const std::string& name) { - if(strcmp(name, "logentry") == 0) + if(name == "logentry") { this->HG->DoRevision(this->Rev, this->Changes); } - else if(strcmp(name, "author") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "author") { this->Rev.Author.assign(&this->CData[0], this->CData.size()); } - else if ( strcmp(name, "email") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "email") { this->Rev.EMail.assign(&this->CData[0], this->CData.size()); } - else if(strcmp(name, "date") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "date") { this->Rev.Date.assign(&this->CData[0], this->CData.size()); } - else if(strcmp(name, "msg") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "msg") { this->Rev.Log.assign(&this->CData[0], this->CData.size()); } - else if(strcmp(name, "files") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "files") { std::vector<std::string> paths = this->SplitCData(); for(unsigned int i = 0; i < paths.size(); ++i) @@ -242,7 +242,7 @@ private: this->Changes.push_back(this->CurChange); } } - else if(strcmp(name, "file_adds") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "file_adds") { std::string added_paths(this->CData.begin(), this->CData.end()); for(unsigned int i = 0; i < this->Changes.size(); ++i) @@ -253,7 +253,7 @@ private: } } } - else if(strcmp(name, "file_dels") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "file_dels") { std::string added_paths(this->CData.begin(), this->CData.end()); for(unsigned int i = 0; i < this->Changes.size(); ++i) diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index cd3bd5746d..c9f9e9e506 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -567,7 +567,7 @@ void cmCTestLaunch::WriteXMLLabels(std::ostream& fxml) fxml << "\n"; fxml << "\t\t<!-- Interested parties -->\n"; fxml << "\t\t<Labels>\n"; - for(std::set<cmStdString>::const_iterator li = this->Labels.begin(); + for(std::set<std::string>::const_iterator li = this->Labels.begin(); li != this->Labels.end(); ++li) { fxml << "\t\t\t<Label>" << cmXMLSafe(*li) << "</Label>\n"; diff --git a/Source/CTest/cmCTestLaunch.h b/Source/CTest/cmCTestLaunch.h index f680d19d94..bc90d28cf6 100644 --- a/Source/CTest/cmCTestLaunch.h +++ b/Source/CTest/cmCTestLaunch.h @@ -73,7 +73,7 @@ private: bool HaveErr; // Labels associated with the build rule. - std::set<cmStdString> Labels; + std::set<std::string> Labels; void LoadLabels(); bool SourceMatches(std::string const& lhs, std::string const& rhs); diff --git a/Source/CTest/cmCTestMemCheckCommand.h b/Source/CTest/cmCTestMemCheckCommand.h index b50170df1c..e239d46421 100644 --- a/Source/CTest/cmCTestMemCheckCommand.h +++ b/Source/CTest/cmCTestMemCheckCommand.h @@ -41,7 +41,7 @@ public: /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() const { return "ctest_memcheck";} + virtual std::string GetName() const { return "ctest_memcheck";} cmTypeMacro(cmCTestMemCheckCommand, cmCTestTestCommand); diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index fdce04d39e..f27dbc0980 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -49,21 +49,15 @@ class cmBoundsCheckerParser : public cmXMLParser { public: cmBoundsCheckerParser(cmCTest* c) { this->CTest = c;} - void StartElement(const char* name, const char** atts) + void StartElement(const std::string& name, const char** atts) { - if(strcmp(name, "MemoryLeak") == 0) + if(name == "MemoryLeak" || + name == "ResourceLeak") { this->Errors.push_back(cmCTestMemCheckHandler::MLK); } - if(strcmp(name, "ResourceLeak") == 0) - { - this->Errors.push_back(cmCTestMemCheckHandler::MLK); - } - if(strcmp(name, "Error") == 0) - { - this->ParseError(atts); - } - if(strcmp(name, "Dangling Pointer") == 0) + else if(name == "Error" || + name == "Dangling Pointer") { this->ParseError(atts); } @@ -79,7 +73,7 @@ public: ostr << "\n"; this->Log += ostr.str(); } - void EndElement(const char* ) + void EndElement(const std::string& ) { } @@ -246,8 +240,8 @@ int cmCTestMemCheckHandler::PostProcessHandler() void cmCTestMemCheckHandler::GenerateTestCommand( std::vector<std::string>& args, int test) { - std::vector<cmStdString>::size_type pp; - cmStdString index; + std::vector<std::string>::size_type pp; + std::string index; cmOStringStream stream; std::string memcheckcommand = cmSystemTools::ConvertToOutputPath(this->MemoryTester.c_str()); @@ -255,9 +249,9 @@ void cmCTestMemCheckHandler::GenerateTestCommand( index = stream.str(); for ( pp = 0; pp < this->MemoryTesterDynamicOptions.size(); pp ++ ) { - cmStdString arg = this->MemoryTesterDynamicOptions[pp]; - cmStdString::size_type pos = arg.find("??"); - if (pos != cmStdString::npos) + std::string arg = this->MemoryTesterDynamicOptions[pp]; + std::string::size_type pos = arg.find("??"); + if (pos != std::string::npos) { arg.replace(pos, 2, index); } @@ -580,7 +574,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() return false; } - std::vector<cmStdString>::size_type cc; + std::vector<std::string>::size_type cc; for ( cc = 0; cmCTestMemCheckResultStrings[cc]; cc ++ ) { this->MemoryTesterGlobalResults[cc] = 0; @@ -627,7 +621,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput( const std::string& str, std::string& log, int* results) { - std::vector<cmStdString> lines; + std::vector<std::string> lines; cmSystemTools::Split(str.c_str(), lines); cmOStringStream ostr; log = ""; @@ -636,7 +630,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput( int defects = 0; - for( std::vector<cmStdString>::iterator i = lines.begin(); + for( std::vector<std::string>::iterator i = lines.begin(); i != lines.end(); ++i) { int failure = cmCTestMemCheckHandler::NO_MEMORY_FAULT; @@ -681,7 +675,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput( const std::string& str, std::string& log, int* results) { - std::vector<cmStdString> lines; + std::vector<std::string> lines; cmSystemTools::Split(str.c_str(), lines); bool unlimitedOutput = false; if(str.find("CTEST_FULL_OUTPUT") != str.npos || @@ -864,10 +858,10 @@ bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput( { log = ""; double sttime = cmSystemTools::GetTime(); - std::vector<cmStdString> lines; + std::vector<std::string> lines; cmSystemTools::Split(str.c_str(), lines); cmCTestLog(this->CTest, DEBUG, "Start test: " << lines.size() << std::endl); - std::vector<cmStdString>::size_type cc; + std::vector<std::string>::size_type cc; for ( cc = 0; cc < lines.size(); cc ++ ) { if(lines[cc] == BOUNDS_CHECKER_MARKER) @@ -923,7 +917,7 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "PostProcessBoundsCheckerTest for : " << res.Name.c_str() << std::endl); - cmStdString ofile = testOutputFileName(test); + std::string ofile = testOutputFileName(test); if ( ofile.empty() ) { return; @@ -979,7 +973,7 @@ void cmCTestMemCheckHandler::appendMemTesterOutput(cmCTestTestResult& res, int test) { - cmStdString ofile = testOutputFileName(test); + std::string ofile = testOutputFileName(test); if ( ofile.empty() ) { @@ -1000,15 +994,15 @@ cmCTestMemCheckHandler::appendMemTesterOutput(cmCTestTestResult& res, } } -cmStdString +std::string cmCTestMemCheckHandler::testOutputFileName(int test) { - cmStdString index; + std::string index; cmOStringStream stream; stream << test; index = stream.str(); - cmStdString ofile = this->MemoryTesterOutputFile; - cmStdString::size_type pos = ofile.find("??"); + std::string ofile = this->MemoryTesterOutputFile; + std::string::size_type pos = ofile.find("??"); ofile.replace(pos, 2, index); if ( !cmSystemTools::FileExists(ofile.c_str()) ) diff --git a/Source/CTest/cmCTestMemCheckHandler.h b/Source/CTest/cmCTestMemCheckHandler.h index 040d2e0929..0521a48412 100644 --- a/Source/CTest/cmCTestMemCheckHandler.h +++ b/Source/CTest/cmCTestMemCheckHandler.h @@ -89,8 +89,8 @@ private: std::string BoundsCheckerDPBDFile; std::string BoundsCheckerXMLFile; std::string MemoryTester; - std::vector<cmStdString> MemoryTesterDynamicOptions; - std::vector<cmStdString> MemoryTesterOptions; + std::vector<std::string> MemoryTesterDynamicOptions; + std::vector<std::string> MemoryTesterOptions; int MemoryTesterStyle; std::string MemoryTesterOutputFile; int MemoryTesterGlobalResults[NO_MEMORY_FAULT]; @@ -103,8 +103,8 @@ private: */ void GenerateDartOutput(std::ostream& os); - std::vector<cmStdString> CustomPreMemCheck; - std::vector<cmStdString> CustomPostMemCheck; + std::vector<std::string> CustomPreMemCheck; + std::vector<std::string> CustomPostMemCheck; //! Parse Valgrind/Purify/Bounds Checker result out of the output //string. After running, log holds the output and results hold the @@ -127,7 +127,7 @@ private: int test); ///! generate the output filename for the given test index - cmStdString testOutputFileName(int test); + std::string testOutputFileName(int test); }; #endif diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index ddd1707bcf..c979be3f3d 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -369,7 +369,7 @@ void cmCTestMultiProcessHandler::UpdateCostData() // Write list of failed tests fout << "---\n"; - for(std::vector<cmStdString>::iterator i = this->Failed->begin(); + for(std::vector<std::string>::iterator i = this->Failed->begin(); i != this->Failed->end(); ++i) { fout << i->c_str() << "\n"; diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h index 1b53ec7c2f..605de31346 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.h +++ b/Source/CTest/cmCTestMultiProcessHandler.h @@ -41,8 +41,8 @@ public: void PrintTestList(); void PrintLabels(); - void SetPassFailVectors(std::vector<cmStdString>* passed, - std::vector<cmStdString>* failed) + void SetPassFailVectors(std::vector<std::string>* passed, + std::vector<std::string>* failed) { this->Passed = passed; this->Failed = failed; @@ -107,9 +107,9 @@ protected: PropertiesMap Properties; std::map<int, bool> TestRunningMap; std::map<int, bool> TestFinishMap; - std::map<int, cmStdString> TestOutput; - std::vector<cmStdString>* Passed; - std::vector<cmStdString>* Failed; + std::map<int, std::string> TestOutput; + std::vector<std::string>* Passed; + std::vector<std::string>* Failed; std::vector<std::string> LastTestsFailed; std::set<std::string> LockedResources; std::vector<cmCTestTestHandler::cmCTestTestResult>* TestResults; diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx index b09d6f5a36..1ad94bc40a 100644 --- a/Source/CTest/cmCTestP4.cxx +++ b/Source/CTest/cmCTestP4.cxx @@ -346,10 +346,10 @@ void cmCTestP4::SetP4Options(std::vector<char const*> &CommandOptions) //The CTEST_P4_OPTIONS variable adds additional Perforce command line //options before the main command std::string opts = this->CTest->GetCTestConfiguration("P4Options"); - std::vector<cmStdString> args = + std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str()); - for(std::vector<cmStdString>::const_iterator ai = args.begin(); + for(std::vector<std::string>::const_iterator ai = args.begin(); ai != args.end(); ++ai) { P4Options.push_back(ai->c_str()); @@ -538,8 +538,8 @@ bool cmCTestP4::UpdateImpl() { opts = this->CTest->GetCTestConfiguration("P4UpdateOptions"); } - std::vector<cmStdString> args = cmSystemTools::ParseArguments(opts.c_str()); - for(std::vector<cmStdString>::const_iterator ai = args.begin(); + std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str()); + for(std::vector<std::string>::const_iterator ai = args.begin(); ai != args.end(); ++ai) { p4_sync.push_back(ai->c_str()); diff --git a/Source/CTest/cmCTestReadCustomFilesCommand.h b/Source/CTest/cmCTestReadCustomFilesCommand.h index 9c0af81986..c95694ae57 100644 --- a/Source/CTest/cmCTestReadCustomFilesCommand.h +++ b/Source/CTest/cmCTestReadCustomFilesCommand.h @@ -46,7 +46,7 @@ public: /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() const { return "ctest_read_custom_files";} + virtual std::string GetName() const { return "ctest_read_custom_files";} cmTypeMacro(cmCTestReadCustomFilesCommand, cmCTestCommand); diff --git a/Source/CTest/cmCTestRunScriptCommand.h b/Source/CTest/cmCTestRunScriptCommand.h index f34bd133ca..0998e5c621 100644 --- a/Source/CTest/cmCTestRunScriptCommand.h +++ b/Source/CTest/cmCTestRunScriptCommand.h @@ -47,7 +47,7 @@ public: /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() const { return "ctest_run_script";} + virtual std::string GetName() const { return "ctest_run_script";} cmTypeMacro(cmCTestRunScriptCommand, cmCTestCommand); }; diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx index 2668c8eef5..86dc2f2fd9 100644 --- a/Source/CTest/cmCTestSVN.cxx +++ b/Source/CTest/cmCTestSVN.cxx @@ -277,7 +277,7 @@ bool cmCTestSVN::UpdateImpl() { opts = this->CTest->GetCTestConfiguration("SVNUpdateOptions"); } - std::vector<cmStdString> args = cmSystemTools::ParseArguments(opts.c_str()); + std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str()); // Specify the start time for nightly testing. if(this->CTest->GetTestModel() == cmCTest::NIGHTLY) @@ -287,7 +287,7 @@ bool cmCTestSVN::UpdateImpl() std::vector<char const*> svn_update; svn_update.push_back("update"); - for(std::vector<cmStdString>::const_iterator ai = args.begin(); + for(std::vector<std::string>::const_iterator ai = args.begin(); ai != args.end(); ++ai) { svn_update.push_back(ai->c_str()); @@ -314,9 +314,9 @@ bool cmCTestSVN::RunSVNCommand(std::vector<char const*> const& parameters, std::string userOptions = this->CTest->GetCTestConfiguration("SVNOptions"); - std::vector<cmStdString> parsedUserOptions = + std::vector<std::string> parsedUserOptions = cmSystemTools::ParseArguments(userOptions.c_str()); - for(std::vector<cmStdString>::iterator i = parsedUserOptions.begin(); + for(std::vector<std::string>::iterator i = parsedUserOptions.begin(); i != parsedUserOptions.end(); ++i) { args.push_back(i->c_str()); @@ -361,10 +361,10 @@ private: return true; } - virtual void StartElement(const char* name, const char** atts) + virtual void StartElement(const std::string& name, const char** atts) { this->CData.clear(); - if(strcmp(name, "logentry") == 0) + if(name == "logentry") { this->Rev = Revision(); this->Rev.SVNInfo = &SVNRepo; @@ -374,7 +374,7 @@ private: } this->Changes.clear(); } - else if(strcmp(name, "path") == 0) + else if(name == "path") { this->CurChange = Change(); if(const char* action = this->FindAttribute(atts, "action")) @@ -389,28 +389,28 @@ private: this->CData.insert(this->CData.end(), data, data+length); } - virtual void EndElement(const char* name) + virtual void EndElement(const std::string& name) { - if(strcmp(name, "logentry") == 0) + if(name == "logentry") { this->SVN->DoRevisionSVN(this->Rev, this->Changes); } - else if(strcmp(name, "path") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "path") { std::string orig_path(&this->CData[0], this->CData.size()); std::string new_path = SVNRepo.BuildLocalPath( orig_path ); this->CurChange.Path.assign(new_path); this->Changes.push_back(this->CurChange); } - else if(strcmp(name, "author") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "author") { this->Rev.Author.assign(&this->CData[0], this->CData.size()); } - else if(strcmp(name, "date") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "date") { this->Rev.Date.assign(&this->CData[0], this->CData.size()); } - else if(strcmp(name, "msg") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "msg") { this->Rev.Log.assign(&this->CData[0], this->CData.size()); } diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 00a0a097c8..7f13855b77 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -231,7 +231,7 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) cmSystemTools::GetCTestCommand() << "\n"); // now pass through all the other arguments - std::vector<cmStdString> &initArgs = + std::vector<std::string> &initArgs = this->CTest->GetInitialCommandLineArguments(); //*** need to make sure this does not have the current script *** for(size_t i=1; i < initArgs.size(); ++i) @@ -766,7 +766,7 @@ int cmCTestScriptHandler::PerformExtraUpdates() // do an initial cvs update as required command = this->UpdateCmd; - std::vector<cmStdString>::iterator it; + std::vector<std::string>::iterator it; for (it = this->ExtraUpdates.begin(); it != this->ExtraUpdates.end(); ++ it ) diff --git a/Source/CTest/cmCTestScriptHandler.h b/Source/CTest/cmCTestScriptHandler.h index 44e9dd0f5f..42c2f209bd 100644 --- a/Source/CTest/cmCTestScriptHandler.h +++ b/Source/CTest/cmCTestScriptHandler.h @@ -138,26 +138,26 @@ private: // Try to remove the binary directory once static bool TryToRemoveBinaryDirectoryOnce(const std::string& directoryPath); - std::vector<cmStdString> ConfigurationScripts; + std::vector<std::string> ConfigurationScripts; std::vector<bool> ScriptProcessScope; bool Backup; bool EmptyBinDir; bool EmptyBinDirOnce; - cmStdString SourceDir; - cmStdString BinaryDir; - cmStdString BackupSourceDir; - cmStdString BackupBinaryDir; - cmStdString CTestRoot; - cmStdString CVSCheckOut; - cmStdString CTestCmd; - cmStdString UpdateCmd; - cmStdString CTestEnv; - cmStdString InitialCache; - cmStdString CMakeCmd; - cmStdString CMOutFile; - std::vector<cmStdString> ExtraUpdates; + std::string SourceDir; + std::string BinaryDir; + std::string BackupSourceDir; + std::string BackupBinaryDir; + std::string CTestRoot; + std::string CVSCheckOut; + std::string CTestCmd; + std::string UpdateCmd; + std::string CTestEnv; + std::string InitialCache; + std::string CMakeCmd; + std::string CMOutFile; + std::vector<std::string> ExtraUpdates; double MinimumInterval; double ContinuousDuration; diff --git a/Source/CTest/cmCTestSleepCommand.h b/Source/CTest/cmCTestSleepCommand.h index c6baf1c57a..740a7e12aa 100644 --- a/Source/CTest/cmCTestSleepCommand.h +++ b/Source/CTest/cmCTestSleepCommand.h @@ -47,7 +47,7 @@ public: /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() const { return "ctest_sleep";} + virtual std::string GetName() const { return "ctest_sleep";} cmTypeMacro(cmCTestSleepCommand, cmCTestCommand); diff --git a/Source/CTest/cmCTestStartCommand.h b/Source/CTest/cmCTestStartCommand.h index e5535c1107..3b8843f35c 100644 --- a/Source/CTest/cmCTestStartCommand.h +++ b/Source/CTest/cmCTestStartCommand.h @@ -55,7 +55,7 @@ public: /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() const { return "ctest_start";} + virtual std::string GetName() const { return "ctest_start";} cmTypeMacro(cmCTestStartCommand, cmCTestCommand); diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index 24974e3bc8..07a994de64 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -72,7 +72,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() if (notesFilesVariable) { std::vector<std::string> notesFiles; - std::vector<cmStdString> newNotesFiles; + cmCTest::VectorOfStrings newNotesFiles; cmSystemTools::ExpandListArgument(notesFilesVariable,notesFiles); std::vector<std::string>::iterator it; for ( it = notesFiles.begin(); @@ -89,7 +89,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() if (extraFilesVariable) { std::vector<std::string> extraFiles; - std::vector<cmStdString> newExtraFiles; + cmCTest::VectorOfStrings newExtraFiles; cmSystemTools::ExpandListArgument(extraFilesVariable,extraFiles); std::vector<std::string>::iterator it; for ( it = extraFiles.begin(); @@ -222,7 +222,7 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg) if(this->ArgumentDoing == ArgumentDoingFiles) { - cmStdString filename(arg); + std::string filename(arg); if(cmSystemTools::FileExists(filename.c_str())) { this->Files.insert(filename); diff --git a/Source/CTest/cmCTestSubmitCommand.h b/Source/CTest/cmCTestSubmitCommand.h index 64c6cae26c..3673fbdec2 100644 --- a/Source/CTest/cmCTestSubmitCommand.h +++ b/Source/CTest/cmCTestSubmitCommand.h @@ -48,7 +48,7 @@ public: /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() const { return "ctest_submit";} + virtual std::string GetName() const { return "ctest_submit";} cmTypeMacro(cmCTestSubmitCommand, cmCTestHandlerCommand); diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 139f515af3..3173f15649 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -68,10 +68,10 @@ private: return val; } - virtual void StartElement(const char* name, const char** atts) + virtual void StartElement(const std::string& name, const char** atts) { this->CurrentValue.clear(); - if(strcmp(name, "cdash") == 0) + if(name == "cdash") { this->CDashVersion = this->FindAttribute(atts, "version"); } @@ -82,9 +82,9 @@ private: this->CurrentValue.insert(this->CurrentValue.end(), data, data+length); } - virtual void EndElement(const char* name) + virtual void EndElement(const std::string& name) { - if(strcmp(name, "status") == 0) + if(name == "status") { std::string status = cmSystemTools::UpperCase(this->GetCurrentValue()); if(status == "OK" || status == "SUCCESS") @@ -100,15 +100,15 @@ private: this->Status = STATUS_ERROR; } } - else if(strcmp(name, "filename") == 0) + else if(name == "filename") { this->Filename = this->GetCurrentValue(); } - else if(strcmp(name, "md5") == 0) + else if(name == "md5") { this->MD5 = this->GetCurrentValue(); } - else if(strcmp(name, "message") == 0) + else if(name == "message") { this->Message = this->GetCurrentValue(); } @@ -170,10 +170,10 @@ void cmCTestSubmitHandler::Initialize() } //---------------------------------------------------------------------------- -bool cmCTestSubmitHandler::SubmitUsingFTP(const cmStdString& localprefix, - const std::set<cmStdString>& files, - const cmStdString& remoteprefix, - const cmStdString& url) +bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix, + const std::set<std::string>& files, + const std::string& remoteprefix, + const std::string& url) { CURL *curl; CURLcode res; @@ -217,12 +217,12 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const cmStdString& localprefix, ::curl_easy_setopt(curl, CURLOPT_UPLOAD, 1); - cmStdString local_file = *file; + std::string local_file = *file; if ( !cmSystemTools::FileExists(local_file.c_str()) ) { local_file = localprefix + "/" + *file; } - cmStdString upload_as + std::string upload_as = url + "/" + remoteprefix + cmSystemTools::GetFilenameName(*file); struct stat st; @@ -324,10 +324,10 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const cmStdString& localprefix, //---------------------------------------------------------------------------- // Uploading files is simpler -bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix, - const std::set<cmStdString>& files, - const cmStdString& remoteprefix, - const cmStdString& url) +bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, + const std::set<std::string>& files, + const std::string& remoteprefix, + const std::string& url) { CURL *curl; CURLcode res; @@ -336,8 +336,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix, /* In windows, this will init the winsock stuff */ ::curl_global_init(CURL_GLOBAL_ALL); - cmStdString dropMethod(this->CTest->GetCTestConfiguration("DropMethod")); - cmStdString curlopt(this->CTest->GetCTestConfiguration("CurlOptions")); + std::string dropMethod(this->CTest->GetCTestConfiguration("DropMethod")); + std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions")); std::vector<std::string> args; cmSystemTools::ExpandListArgument(curlopt.c_str(), args); bool verifyPeerOff = false; @@ -354,7 +354,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix, verifyHostOff = true; } } - cmStdString::size_type kk; + std::string::size_type kk; cmCTest::SetOfStrings::const_iterator file; for ( file = files.begin(); file != files.end(); ++file ) { @@ -414,18 +414,18 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix, ::curl_easy_setopt(curl, CURLOPT_PUT, 1); ::curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); - cmStdString local_file = *file; + std::string local_file = *file; if ( !cmSystemTools::FileExists(local_file.c_str()) ) { local_file = localprefix + "/" + *file; } - cmStdString remote_file + std::string remote_file = remoteprefix + cmSystemTools::GetFilenameName(*file); *this->LogFile << "\tUpload file: " << local_file.c_str() << " to " << remote_file.c_str() << std::endl; - cmStdString ofile = ""; + std::string ofile = ""; for ( kk = 0; kk < remote_file.size(); kk ++ ) { char c = remote_file[kk]; @@ -448,8 +448,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix, ofile.append(hexCh); } } - cmStdString upload_as - = url + ((url.find("?",0) == cmStdString::npos) ? "?" : "&") + std::string upload_as + = url + ((url.find("?",0) == std::string::npos) ? "?" : "&") + "FileName=" + ofile; upload_as += "&MD5="; @@ -666,9 +666,9 @@ void cmCTestSubmitHandler //---------------------------------------------------------------------------- bool cmCTestSubmitHandler::TriggerUsingHTTP( - const std::set<cmStdString>& files, - const cmStdString& remoteprefix, - const cmStdString& url) + const std::set<std::string>& files, + const std::string& remoteprefix, + const std::string& url) { CURL *curl; char error_buffer[1024]; @@ -721,10 +721,10 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP( ::curl_easy_setopt(curl, CURLOPT_FILE, (void *)&chunk); ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void *)&chunkDebug); - cmStdString rfile + std::string rfile = remoteprefix + cmSystemTools::GetFilenameName(*file); - cmStdString ofile = ""; - cmStdString::iterator kk; + std::string ofile = ""; + std::string::iterator kk; for ( kk = rfile.begin(); kk < rfile.end(); ++ kk) { char c = *kk; @@ -747,8 +747,8 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP( ofile.append(hexCh); } } - cmStdString turl - = url + ((url.find("?",0) == cmStdString::npos) ? "?" : "&") + std::string turl + = url + ((url.find("?",0) == std::string::npos) ? "?" : "&") + "xmlfile=" + ofile; *this->LogFile << "Trigger url: " << turl.c_str() << std::endl; cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Trigger url: " @@ -805,11 +805,11 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP( //---------------------------------------------------------------------------- bool cmCTestSubmitHandler::SubmitUsingSCP( - const cmStdString& scp_command, - const cmStdString& localprefix, - const std::set<cmStdString>& files, - const cmStdString& remoteprefix, - const cmStdString& url) + const std::string& scp_command, + const std::string& localprefix, + const std::set<std::string>& files, + const std::string& remoteprefix, + const std::string& url) { if ( !scp_command.size() || !localprefix.size() || !files.size() || !remoteprefix.size() || !url.size() ) @@ -906,10 +906,10 @@ bool cmCTestSubmitHandler::SubmitUsingSCP( //---------------------------------------------------------------------------- bool cmCTestSubmitHandler::SubmitUsingCP( - const cmStdString& localprefix, - const std::set<cmStdString>& files, - const cmStdString& remoteprefix, - const cmStdString& destination) + const std::string& localprefix, + const std::set<std::string>& files, + const std::string& remoteprefix, + const std::string& destination) { if ( !localprefix.size() || !files.size() || !remoteprefix.size() || !destination.size() ) @@ -947,17 +947,17 @@ bool cmCTestSubmitHandler::SubmitUsingCP( //---------------------------------------------------------------------------- #if defined(CTEST_USE_XMLRPC) -bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const cmStdString& localprefix, - const std::set<cmStdString>& files, - const cmStdString& remoteprefix, - const cmStdString& url) +bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const std::string& localprefix, + const std::set<std::string>& files, + const std::string& remoteprefix, + const std::string& url) { xmlrpc_env env; char ctestString[] = "CTest"; std::string ctestVersionString = cmVersion::GetCMakeVersion(); char* ctestVersion = const_cast<char*>(ctestVersionString.c_str()); - cmStdString realURL = url + "/" + remoteprefix + "/Command/"; + std::string realURL = url + "/" + remoteprefix + "/Command/"; /* Start up our XML-RPC client library. */ xmlrpc_client_init(XMLRPC_CLIENT_NO_FLAGS, ctestString, ctestVersion); @@ -973,7 +973,7 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const cmStdString& localprefix, { xmlrpc_value *result; - cmStdString local_file = *file; + std::string local_file = *file; if ( !cmSystemTools::FileExists(local_file.c_str()) ) { local_file = localprefix + "/" + *file; @@ -1045,10 +1045,10 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const cmStdString& localprefix, return true; } #else -bool cmCTestSubmitHandler::SubmitUsingXMLRPC(cmStdString const&, - std::set<cmStdString> const&, - cmStdString const&, - cmStdString const&) +bool cmCTestSubmitHandler::SubmitUsingXMLRPC(std::string const&, + std::set<std::string> const&, + std::string const&, + std::string const&) { return false; } @@ -1085,7 +1085,7 @@ int cmCTestSubmitHandler::ProcessHandler() } if ( getenv("HTTP_PROXY_TYPE") ) { - cmStdString type = getenv("HTTP_PROXY_TYPE"); + std::string type = getenv("HTTP_PROXY_TYPE"); // HTTP/SOCKS4/SOCKS5 if ( type == "HTTP" ) { @@ -1122,7 +1122,7 @@ int cmCTestSubmitHandler::ProcessHandler() } if ( getenv("FTP_PROXY_TYPE") ) { - cmStdString type = getenv("FTP_PROXY_TYPE"); + std::string type = getenv("FTP_PROXY_TYPE"); // HTTP/SOCKS4/SOCKS5 if ( type == "HTTP" ) { @@ -1178,7 +1178,7 @@ int cmCTestSubmitHandler::ProcessHandler() this->CTest->AddIfExists(cmCTest::PartTest, "Test.xml"); if(this->CTest->AddIfExists(cmCTest::PartCoverage, "Coverage.xml")) { - cmCTest::VectorOfStrings gfiles; + std::vector<std::string> gfiles; std::string gpath = buildDirectory + "/Testing/" + this->CTest->GetCurrentTag(); std::string::size_type glen = gpath.size() + 1; @@ -1247,7 +1247,7 @@ int cmCTestSubmitHandler::ProcessHandler() } this->SetLogFile(&ofs); - cmStdString dropMethod(this->CTest->GetCTestConfiguration("DropMethod")); + std::string dropMethod(this->CTest->GetCTestConfiguration("DropMethod")); if ( dropMethod == "" || dropMethod == "ftp" ) { diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h index 14eac80b52..accabd1c5a 100644 --- a/Source/CTest/cmCTestSubmitHandler.h +++ b/Source/CTest/cmCTestSubmitHandler.h @@ -47,33 +47,33 @@ private: /** * Submit file using various ways */ - bool SubmitUsingFTP(const cmStdString& localprefix, - const std::set<cmStdString>& files, - const cmStdString& remoteprefix, - const cmStdString& url); - bool SubmitUsingHTTP(const cmStdString& localprefix, - const std::set<cmStdString>& files, - const cmStdString& remoteprefix, - const cmStdString& url); - bool SubmitUsingSCP(const cmStdString& scp_command, - const cmStdString& localprefix, - const std::set<cmStdString>& files, - const cmStdString& remoteprefix, - const cmStdString& url); - - bool SubmitUsingCP( const cmStdString& localprefix, - const std::set<cmStdString>& files, - const cmStdString& remoteprefix, - const cmStdString& url); - - bool TriggerUsingHTTP(const std::set<cmStdString>& files, - const cmStdString& remoteprefix, - const cmStdString& url); - - bool SubmitUsingXMLRPC(const cmStdString& localprefix, - const std::set<cmStdString>& files, - const cmStdString& remoteprefix, - const cmStdString& url); + bool SubmitUsingFTP(const std::string& localprefix, + const std::set<std::string>& files, + const std::string& remoteprefix, + const std::string& url); + bool SubmitUsingHTTP(const std::string& localprefix, + const std::set<std::string>& files, + const std::string& remoteprefix, + const std::string& url); + bool SubmitUsingSCP(const std::string& scp_command, + const std::string& localprefix, + const std::set<std::string>& files, + const std::string& remoteprefix, + const std::string& url); + + bool SubmitUsingCP( const std::string& localprefix, + const std::set<std::string>& files, + const std::string& remoteprefix, + const std::string& url); + + bool TriggerUsingHTTP(const std::set<std::string>& files, + const std::string& remoteprefix, + const std::string& url); + + bool SubmitUsingXMLRPC(const std::string& localprefix, + const std::set<std::string>& files, + const std::string& remoteprefix, + const std::string& url); typedef std::vector<char> cmCTestSubmitHandlerVectorOfChar; @@ -82,10 +82,10 @@ private: std::string GetSubmitResultsPrefix(); class ResponseParser; - cmStdString HTTPProxy; + std::string HTTPProxy; int HTTPProxyType; - cmStdString HTTPProxyAuth; - cmStdString FTPProxy; + std::string HTTPProxyAuth; + std::string FTPProxy; int FTPProxyType; std::ostream* LogFile; bool SubmitPart[cmCTest::PartCount]; diff --git a/Source/CTest/cmCTestTestCommand.h b/Source/CTest/cmCTestTestCommand.h index 451ac99ff1..a1e5f368fe 100644 --- a/Source/CTest/cmCTestTestCommand.h +++ b/Source/CTest/cmCTestTestCommand.h @@ -39,7 +39,7 @@ public: /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() const { return "ctest_test";} + virtual std::string GetName() const { return "ctest_test";} cmTypeMacro(cmCTestTestCommand, cmCTestHandlerCommand); diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 3a04b332d3..59706568f6 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -60,7 +60,7 @@ public: /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() const { return "subdirs";} + virtual std::string GetName() const { return "subdirs";} cmTypeMacro(cmCTestSubdirCommand, cmCommand); @@ -157,7 +157,7 @@ public: /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() const { return "add_subdirectory";} + virtual std::string GetName() const { return "add_subdirectory";} cmTypeMacro(cmCTestAddSubdirectoryCommand, cmCommand); @@ -243,7 +243,7 @@ public: /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() const { return "add_test";} + virtual std::string GetName() const { return "add_test";} cmTypeMacro(cmCTestAddTestCommand, cmCommand); @@ -287,7 +287,7 @@ public: /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() const { return "set_tests_properties";} + virtual std::string GetName() const { return "set_tests_properties";} cmTypeMacro(cmCTestSetTestsPropertiesCommand, cmCommand); @@ -540,8 +540,8 @@ int cmCTestTestHandler::ProcessHandler() this->StartLogFile((this->MemCheck ? "DynamicAnalysis" : "Test"), mLogFile); this->LogFile = &mLogFile; - std::vector<cmStdString> passed; - std::vector<cmStdString> failed; + std::vector<std::string> passed; + std::vector<std::string> failed; int total; //start the real time clock @@ -569,7 +569,7 @@ int cmCTestTestHandler::ProcessHandler() { cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl << "The following tests passed:" << std::endl); - for(std::vector<cmStdString>::iterator j = passed.begin(); + for(std::vector<std::string>::iterator j = passed.begin(); j != passed.end(); ++j) { cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "\t" << *j @@ -661,8 +661,8 @@ void cmCTestTestHandler::PrintLabelSummary() cmCTestTestHandler::ListOfTests::iterator it = this->TestList.begin(); cmCTestTestHandler::TestResultsVector::iterator ri = this->TestResults.begin(); - std::map<cmStdString, double> labelTimes; - std::set<cmStdString> labels; + std::map<std::string, double> labelTimes; + std::set<std::string> labels; // initialize maps std::string::size_type maxlen = 0; for(; it != this->TestList.end(); ++it) @@ -702,7 +702,7 @@ void cmCTestTestHandler::PrintLabelSummary() { cmCTestLog(this->CTest, HANDLER_OUTPUT, "\nLabel Time Summary:"); } - for(std::set<cmStdString>::const_iterator i = labels.begin(); + for(std::set<std::string>::const_iterator i = labels.begin(); i != labels.end(); ++i) { std::string label = *i; @@ -1050,8 +1050,8 @@ bool cmCTestTestHandler::GetValue(const char* tag, } //--------------------------------------------------------------------- -void cmCTestTestHandler::ProcessDirectory(std::vector<cmStdString> &passed, - std::vector<cmStdString> &failed) +void cmCTestTestHandler::ProcessDirectory(std::vector<std::string> &passed, + std::vector<std::string> &failed) { this->ComputeTestList(); this->StartTest = this->CTest->CurrentTime(); @@ -1216,7 +1216,7 @@ void cmCTestTestHandler::GenerateDartOutput(std::ostream& os) << "name=\"Command Line\"><Value>" << cmXMLSafe(result->FullCommandLine) << "</Value></NamedMeasurement>\n"; - std::map<cmStdString,cmStdString>::iterator measureIt; + std::map<std::string,std::string>::iterator measureIt; for ( measureIt = result->Properties->Measurements.begin(); measureIt != result->Properties->Measurements.end(); ++ measureIt ) @@ -1328,9 +1328,9 @@ void cmCTestTestHandler::AttachFiles(std::ostream& os, } //---------------------------------------------------------------------- -int cmCTestTestHandler::ExecuteCommands(std::vector<cmStdString>& vec) +int cmCTestTestHandler::ExecuteCommands(std::vector<std::string>& vec) { - std::vector<cmStdString>::iterator it; + std::vector<std::string>::iterator it; for ( it = vec.begin(); it != vec.end(); ++it ) { int retVal = 0; @@ -2112,7 +2112,7 @@ bool cmCTestTestHandler::SetTestsProperties( const std::vector<std::string>& args) { std::vector<std::string>::const_iterator it; - std::vector<cmStdString> tests; + std::vector<std::string> tests; bool found = false; for ( it = args.begin(); it != args.end(); ++ it ) { @@ -2137,7 +2137,7 @@ bool cmCTestTestHandler::SetTestsProperties( break; } std::string val = *it; - std::vector<cmStdString>::const_iterator tit; + std::vector<std::string>::const_iterator tit; for ( tit = tests.begin(); tit != tests.end(); ++ tit ) { cmCTestTestHandler::ListOfTests::iterator rtit; @@ -2319,7 +2319,7 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args) } if ( this->MemCheck ) { - std::vector<cmStdString>::iterator it; + std::vector<std::string>::iterator it; bool found = false; for ( it = this->CustomTestsIgnore.begin(); it != this->CustomTestsIgnore.end(); ++ it ) @@ -2339,7 +2339,7 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args) } else { - std::vector<cmStdString>::iterator it; + std::vector<std::string>::iterator it; bool found = false; for ( it = this->CustomTestsIgnore.begin(); it != this->CustomTestsIgnore.end(); ++ it ) diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h index 63f9c9368e..fe43bb893e 100644 --- a/Source/CTest/cmCTestTestHandler.h +++ b/Source/CTest/cmCTestTestHandler.h @@ -87,8 +87,8 @@ public: // ctest -j N will break for that feature struct cmCTestTestProperties { - cmStdString Name; - cmStdString Directory; + std::string Name; + std::string Directory; std::vector<std::string> Args; std::vector<std::string> RequiredFiles; std::vector<std::string> Depends; @@ -98,7 +98,7 @@ public: std::string> > ErrorRegularExpressions; std::vector<std::pair<cmsys::RegularExpression, std::string> > RequiredRegularExpressions; - std::map<cmStdString, cmStdString> Measurements; + std::map<std::string, std::string> Measurements; bool IsInBasedOnREOptions; bool WillFail; float Cost; @@ -162,7 +162,7 @@ protected: virtual int PreProcessHandler(); virtual int PostProcessHandler(); virtual void GenerateTestCommand(std::vector<std::string>& args, int test); - int ExecuteCommands(std::vector<cmStdString>& vec); + int ExecuteCommands(std::vector<std::string>& vec); void WriteTestResultHeader(std::ostream& os, cmCTestTestResult* result); void WriteTestResultFooter(std::ostream& os, cmCTestTestResult* result); @@ -177,7 +177,7 @@ protected: typedef std::vector<cmCTestTestResult> TestResultsVector; TestResultsVector TestResults; - std::vector<cmStdString> CustomTestsIgnore; + std::vector<std::string> CustomTestsIgnore; std::string StartTest; std::string EndTest; unsigned int StartTestTime; @@ -210,8 +210,8 @@ private: /** * Run the tests for a directory and any subdirectories */ - void ProcessDirectory(std::vector<cmStdString> &passed, - std::vector<cmStdString> &failed); + void ProcessDirectory(std::vector<std::string> &passed, + std::vector<std::string> &failed); /** * Get the list of tests in directory and subdirectories. @@ -251,8 +251,8 @@ private: void ExpandTestsToRunInformation(size_t numPossibleTests); void ExpandTestsToRunInformationForRerunFailed(); - std::vector<cmStdString> CustomPreTest; - std::vector<cmStdString> CustomPostTest; + std::vector<std::string> CustomPreTest; + std::vector<std::string> CustomPostTest; std::vector<int> TestsToRun; diff --git a/Source/CTest/cmCTestUpdateCommand.h b/Source/CTest/cmCTestUpdateCommand.h index a785bd8609..fb80333b7f 100644 --- a/Source/CTest/cmCTestUpdateCommand.h +++ b/Source/CTest/cmCTestUpdateCommand.h @@ -39,7 +39,7 @@ public: /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() const { return "ctest_update";} + virtual std::string GetName() const { return "ctest_update";} cmTypeMacro(cmCTestUpdateCommand, cmCTestHandlerCommand); diff --git a/Source/CTest/cmCTestUploadCommand.cxx b/Source/CTest/cmCTestUploadCommand.cxx index 731c1c7a36..f7de29471f 100644 --- a/Source/CTest/cmCTestUploadCommand.cxx +++ b/Source/CTest/cmCTestUploadCommand.cxx @@ -47,7 +47,7 @@ bool cmCTestUploadCommand::CheckArgumentValue(std::string const& arg) { if(this->ArgumentDoing == ArgumentDoingFiles) { - cmStdString filename(arg); + std::string filename(arg); if(cmSystemTools::FileExists(filename.c_str())) { this->Files.insert(filename); diff --git a/Source/CTest/cmCTestUploadCommand.h b/Source/CTest/cmCTestUploadCommand.h index e867fb687f..4a07608d25 100644 --- a/Source/CTest/cmCTestUploadCommand.h +++ b/Source/CTest/cmCTestUploadCommand.h @@ -43,7 +43,7 @@ public: /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() const { return "ctest_upload";} + virtual std::string GetName() const { return "ctest_upload";} cmTypeMacro(cmCTestUploadCommand, cmCTestHandlerCommand); diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx index fbee2272e3..f89fa2ba5a 100644 --- a/Source/CTest/cmCTestVC.cxx +++ b/Source/CTest/cmCTestVC.cxx @@ -63,9 +63,9 @@ bool cmCTestVC::InitialCheckout(const char* command) } // Construct the initial checkout command line. - std::vector<cmStdString> args = cmSystemTools::ParseArguments(command); + std::vector<std::string> args = cmSystemTools::ParseArguments(command); std::vector<char const*> vc_co; - for(std::vector<cmStdString>::const_iterator ai = args.begin(); + for(std::vector<std::string>::const_iterator ai = args.begin(); ai != args.end(); ++ai) { vc_co.push_back(ai->c_str()); diff --git a/Source/CTest/cmParseGTMCoverage.cxx b/Source/CTest/cmParseGTMCoverage.cxx index 528d0dbaa2..5bcfeaca48 100644 --- a/Source/CTest/cmParseGTMCoverage.cxx +++ b/Source/CTest/cmParseGTMCoverage.cxx @@ -182,7 +182,7 @@ bool cmParseGTMCoverage::ParseMCOVLine(std::string const& line, // ( file , entry ) = "number_executed:timing_info" // ^COVERAGE("%RSEL","init",8,"FOR_LOOP",1)=1 // ( file , entry, line, IGNORE ) =number_executed - std::vector<cmStdString> args; + std::vector<std::string> args; std::string::size_type pos = line.find('(', 0); // if no ( is found, then return line has no coverage if(pos == std::string::npos) diff --git a/Source/CTest/cmParseMumpsCoverage.cxx b/Source/CTest/cmParseMumpsCoverage.cxx index 6226febfd0..fe98964c50 100644 --- a/Source/CTest/cmParseMumpsCoverage.cxx +++ b/Source/CTest/cmParseMumpsCoverage.cxx @@ -140,7 +140,7 @@ bool cmParseMumpsCoverage::LoadPackages(const char* d) bool cmParseMumpsCoverage::FindMumpsFile(std::string const& routine, std::string& filepath) { - std::map<cmStdString, cmStdString>::iterator i = + std::map<std::string, std::string>::iterator i = this->RoutineToDirectory.find(routine); if(i != this->RoutineToDirectory.end()) { diff --git a/Source/CTest/cmParseMumpsCoverage.h b/Source/CTest/cmParseMumpsCoverage.h index c1effa79b4..bc71891688 100644 --- a/Source/CTest/cmParseMumpsCoverage.h +++ b/Source/CTest/cmParseMumpsCoverage.h @@ -44,7 +44,7 @@ protected: bool FindMumpsFile(std::string const& routine, std::string& filepath); protected: - std::map<cmStdString, cmStdString> RoutineToDirectory; + std::map<std::string, std::string> RoutineToDirectory; cmCTestCoverageHandlerContainer& Coverage; cmCTest* CTest; }; diff --git a/Source/CTest/cmParsePHPCoverage.cxx b/Source/CTest/cmParsePHPCoverage.cxx index 1c26c1c597..3b7f968f68 100644 --- a/Source/CTest/cmParsePHPCoverage.cxx +++ b/Source/CTest/cmParsePHPCoverage.cxx @@ -34,7 +34,7 @@ bool cmParsePHPCoverage::ReadUntil(std::istream& in, char until) return true; } bool cmParsePHPCoverage::ReadCoverageArray(std::istream& in, - cmStdString const& fileName) + std::string const& fileName) { cmCTestCoverageHandlerContainer::SingleFileCoverageVector& coverageVector = this->Coverage.TotalCoverage[fileName]; @@ -166,7 +166,7 @@ bool cmParsePHPCoverage::ReadFileInformation(std::istream& in) // read the string data in.read(s, size-1); s[size-1] = 0; - cmStdString fileName = s; + std::string fileName = s; delete [] s; // read close quote if(in.get(c) && c != '"') diff --git a/Source/CTest/cmParsePHPCoverage.h b/Source/CTest/cmParsePHPCoverage.h index 035a093c91..92a76347f1 100644 --- a/Source/CTest/cmParsePHPCoverage.h +++ b/Source/CTest/cmParsePHPCoverage.h @@ -35,7 +35,7 @@ private: bool ReadArraySize(std::istream& in, int& size); bool ReadFileInformation(std::istream& in); bool ReadInt(std::istream& in, int& v); - bool ReadCoverageArray(std::istream& in, cmStdString const&); + bool ReadCoverageArray(std::istream& in, std::string const&); bool ReadUntil(std::istream& in, char until); cmCTestCoverageHandlerContainer& Coverage; cmCTest* CTest; diff --git a/Source/CTest/cmParsePythonCoverage.cxx b/Source/CTest/cmParsePythonCoverage.cxx index 38a770ac81..2578bb8766 100644 --- a/Source/CTest/cmParsePythonCoverage.cxx +++ b/Source/CTest/cmParsePythonCoverage.cxx @@ -20,9 +20,9 @@ public: protected: - virtual void StartElement(const char* name, const char** atts) + virtual void StartElement(const std::string& name, const char** atts) { - if(strcmp(name, "class") == 0) + if(name == "class") { int tagCount = 0; while(true) @@ -57,7 +57,7 @@ protected: ++tagCount; } } - else if(strcmp(name, "line") == 0) + else if(name == "line") { int tagCount = 0; int curNumber = -1; @@ -85,7 +85,7 @@ protected: } } - virtual void EndElement(const char*) {} + virtual void EndElement(const std::string&) {} private: |