diff options
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestBuildAndTestHandler.cxx | 16 | ||||
-rw-r--r-- | Source/CTest/cmCTestBuildHandler.cxx | 8 | ||||
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 42 | ||||
-rw-r--r-- | Source/CTest/cmCTestGIT.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestHandlerCommand.cxx | 4 | ||||
-rw-r--r-- | Source/CTest/cmCTestLaunch.cxx | 8 | ||||
-rw-r--r-- | Source/CTest/cmCTestMemCheckHandler.cxx | 6 | ||||
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.cxx | 18 | ||||
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 4 | ||||
-rw-r--r-- | Source/CTest/cmCTestScriptHandler.cxx | 30 | ||||
-rw-r--r-- | Source/CTest/cmCTestStartCommand.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestSubmitHandler.cxx | 22 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 30 | ||||
-rw-r--r-- | Source/CTest/cmParseCacheCoverage.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmParseGTMCoverage.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmParsePHPCoverage.cxx | 2 |
16 files changed, 99 insertions, 99 deletions
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 41db042..a101e39 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -109,7 +109,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring, out << "Error: cmake execution failed\n"; out << cmakeOutString << "\n"; // return to the original directory - cmSystemTools::ChangeDirectory(cwd.c_str()); + cmSystemTools::ChangeDirectory(cwd); if(outstring) { *outstring = out.str(); @@ -128,7 +128,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring, out << "Error: cmake execution failed\n"; out << cmakeOutString << "\n"; // return to the original directory - cmSystemTools::ChangeDirectory(cwd.c_str()); + cmSystemTools::ChangeDirectory(cwd); if(outstring) { *outstring = out.str(); @@ -241,11 +241,11 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); out << "Internal cmake changing into directory: " << this->BinaryDir << std::endl; - if (!cmSystemTools::FileIsDirectory(this->BinaryDir.c_str())) + if (!cmSystemTools::FileIsDirectory(this->BinaryDir)) { cmSystemTools::MakeDirectory(this->BinaryDir.c_str()); } - cmSystemTools::ChangeDirectory(this->BinaryDir.c_str()); + cmSystemTools::ChangeDirectory(this->BinaryDir); if(this->BuildNoCMake) { @@ -374,7 +374,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) cmCTestLog(this->CTest, ERROR_MESSAGE, out.str()); } // return to the original directory - cmSystemTools::ChangeDirectory(cwd.c_str()); + cmSystemTools::ChangeDirectory(cwd); return 1; } @@ -391,7 +391,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) if(this->BuildRunDir.size()) { out << "Run test in directory: " << this->BuildRunDir << "\n"; - cmSystemTools::ChangeDirectory(this->BuildRunDir.c_str()); + cmSystemTools::ChangeDirectory(this->BuildRunDir); } out << "Running test command: \"" << fullPath << "\""; for(size_t k=0; k < this->TestCommandArgs.size(); ++k) @@ -453,9 +453,9 @@ int cmCTestBuildAndTestHandler::ProcessCommandLineArguments( // dir must exist before CollapseFullPath is called cmSystemTools::MakeDirectory(this->BinaryDir.c_str()); this->BinaryDir - = cmSystemTools::CollapseFullPath(this->BinaryDir.c_str()); + = cmSystemTools::CollapseFullPath(this->BinaryDir); this->SourceDir - = cmSystemTools::CollapseFullPath(this->SourceDir.c_str()); + = cmSystemTools::CollapseFullPath(this->SourceDir); } else { diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 2ec1365..7db04d1 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -610,7 +610,7 @@ void cmCTestBuildHandler::GenerateXMLLaunched(std::ostream& os) int numWarningsAllowed = this->MaxWarnings; // Identify fragments on disk. cmsys::Directory launchDir; - launchDir.Load(this->CTestLaunchDir.c_str()); + launchDir.Load(this->CTestLaunchDir); unsigned long n = launchDir.GetNumberOfFiles(); for(unsigned long i=0; i < n; ++i) { @@ -649,7 +649,7 @@ void cmCTestBuildHandler::GenerateXMLLogScraped(std::ostream& os) std::string srcdir = this->CTest->GetCTestConfiguration("SourceDirectory"); // make sure the source dir is in the correct case on windows // via a call to collapse full path. - srcdir = cmSystemTools::CollapseFullPath(srcdir.c_str()); + srcdir = cmSystemTools::CollapseFullPath(srcdir); srcdir += "/"; for ( it = ew.begin(); it != ew.end() && (numErrorsAllowed || numWarningsAllowed); it++ ) @@ -695,7 +695,7 @@ void cmCTestBuildHandler::GenerateXMLLogScraped(std::ostream& os) { // make sure it is a full path with the correct case cm->SourceFile = cmSystemTools::CollapseFullPath( - cm->SourceFile.c_str()); + cm->SourceFile); cmSystemTools::ReplaceString( cm->SourceFile, srcdir.c_str(), ""); } @@ -822,7 +822,7 @@ cmCTestBuildHandler::LaunchHelper::LaunchHelper(cmCTestBuildHandler* handler): launchDir += "/Build"; // Clean out any existing launcher fragments. - cmSystemTools::RemoveADirectory(launchDir.c_str()); + cmSystemTools::RemoveADirectory(launchDir); if(this->Handler->UseCTestLaunch) { diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 76f6584..4b322a8 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -164,7 +164,7 @@ void cmCTestCoverageHandler::CleanCoverageLogFiles(std::ostream& log) fi != files.end(); ++fi) { log << "Removing old coverage log: " << *fi << "\n"; - cmSystemTools::RemoveFile(fi->c_str()); + cmSystemTools::RemoveFile(*fi); } } @@ -237,10 +237,10 @@ bool cmCTestCoverageHandler::ShouldIDoCoverage(const char* file, std::string fSrcDir = cmSystemTools::CollapseFullPath(srcDir); std::string fBinDir = cmSystemTools::CollapseFullPath(binDir); std::string fFile = cmSystemTools::CollapseFullPath(file); - bool sourceSubDir = cmSystemTools::IsSubDirectory(fFile.c_str(), - fSrcDir.c_str()); - bool buildSubDir = cmSystemTools::IsSubDirectory(fFile.c_str(), - fBinDir.c_str()); + bool sourceSubDir = cmSystemTools::IsSubDirectory(fFile, + fSrcDir); + bool buildSubDir = cmSystemTools::IsSubDirectory(fFile, + fBinDir); // Always check parent directory of the file. std::string fileDir = cmSystemTools::GetFilenamePath(fFile); std::string checkDir; @@ -758,8 +758,8 @@ void cmCTestCoverageHandler::PopulateCustomVectors(cmMakefile *mf) //---------------------------------------------------------------------- bool IsFileInDir(const std::string &infile, const std::string &indir) { - std::string file = cmSystemTools::CollapseFullPath(infile.c_str()); - std::string dir = cmSystemTools::CollapseFullPath(indir.c_str()); + std::string file = cmSystemTools::CollapseFullPath(infile); + std::string dir = cmSystemTools::CollapseFullPath(indir); if ( file.size() > dir.size() && @@ -779,7 +779,7 @@ int cmCTestCoverageHandler::HandlePHPCoverage( { cmParsePHPCoverage cov(*cont, this->CTest); std::string coverageDir = this->CTest->GetBinaryDir() + "/xdebugCoverage"; - if(cmSystemTools::FileIsDirectory(coverageDir.c_str())) + if(cmSystemTools::FileIsDirectory(coverageDir)) { cov.ReadPHPCoverageDirectory(coverageDir.c_str()); } @@ -974,7 +974,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( std::string tempDir = testingDir + "/CoverageInfo"; std::string currentDirectory = cmSystemTools::GetCurrentWorkingDirectory(); cmSystemTools::MakeDirectory(tempDir.c_str()); - cmSystemTools::ChangeDirectory(tempDir.c_str()); + cmSystemTools::ChangeDirectory(tempDir); int gcovStyle = 0; @@ -1295,7 +1295,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( *cont->OFS << " produced in source dir: " << sourceFile << std::endl; actualSourceFile - = cmSystemTools::CollapseFullPath(sourceFile.c_str()); + = cmSystemTools::CollapseFullPath(sourceFile); } else if ( IsFileInDir(sourceFile, cont->BinaryDir) ) { @@ -1304,7 +1304,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( *cont->OFS << " produced in binary dir: " << sourceFile << std::endl; actualSourceFile - = cmSystemTools::CollapseFullPath(sourceFile.c_str()); + = cmSystemTools::CollapseFullPath(sourceFile); } if ( actualSourceFile.empty() ) @@ -1345,7 +1345,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( } } - cmSystemTools::ChangeDirectory(currentDirectory.c_str()); + cmSystemTools::ChangeDirectory(currentDirectory); return file_count; } @@ -1409,8 +1409,8 @@ int cmCTestCoverageHandler::HandleLCovCoverage( for ( it = files.begin(); it != files.end(); ++ it ) { cmCTestLog(this->CTest, HANDLER_OUTPUT, "." << std::flush); - std::string fileDir = cmSystemTools::GetFilenamePath(it->c_str()); - cmSystemTools::ChangeDirectory(fileDir.c_str()); + std::string fileDir = cmSystemTools::GetFilenamePath(*it); + cmSystemTools::ChangeDirectory(fileDir); std::string command = "\"" + lcovCommand + "\" " + lcovExtraFlags + " "; @@ -1609,7 +1609,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage( } } - cmSystemTools::ChangeDirectory(currentDirectory.c_str()); + cmSystemTools::ChangeDirectory(currentDirectory); return file_count; } @@ -1653,7 +1653,7 @@ void cmCTestCoverageHandler::FindLCovFiles(std::vector<std::string>& files) gl.RecurseThroughSymlinksOff(); std::string prevBinaryDir; cmSystemTools::ChangeDirectory( - this->CTest->GetCTestConfiguration("BuildDirectory").c_str()); + this->CTest->GetCTestConfiguration("BuildDirectory")); // Run profmerge to merge all *.dyn files into dpi files cmSystemTools::RunSingleCommand("profmerge"); @@ -1696,9 +1696,9 @@ int cmCTestCoverageHandler::HandleTracePyCoverage( std::string tempDir = testingDir + "/CoverageInfo"; std::string currentDirectory = cmSystemTools::GetCurrentWorkingDirectory(); cmSystemTools::MakeDirectory(tempDir.c_str()); - cmSystemTools::ChangeDirectory(tempDir.c_str()); + cmSystemTools::ChangeDirectory(tempDir); - cmSystemTools::ChangeDirectory(currentDirectory.c_str()); + cmSystemTools::ChangeDirectory(currentDirectory); std::vector<std::string>::iterator fileIt; int file_count = 0; @@ -1714,7 +1714,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage( } std::string actualSourceFile - = cmSystemTools::CollapseFullPath(fileName.c_str()); + = cmSystemTools::CollapseFullPath(fileName); cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Check coverage for file: " << actualSourceFile << std::endl); @@ -1802,7 +1802,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage( } ++ file_count; } - cmSystemTools::ChangeDirectory(currentDirectory.c_str()); + cmSystemTools::ChangeDirectory(currentDirectory); return file_count; } @@ -2132,7 +2132,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary( file += "/"; file += sourceFile; } - file = cmSystemTools::CollapseFullPath(file.c_str()); + file = cmSystemTools::CollapseFullPath(file); bool shouldIDoCoverage = this->ShouldIDoCoverage(file.c_str(), cont->SourceDir.c_str(), diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx index aaa01b2..98bc9d7 100644 --- a/Source/CTest/cmCTestGIT.cxx +++ b/Source/CTest/cmCTestGIT.cxx @@ -158,7 +158,7 @@ std::string cmCTestGIT::FindTopDir() { top_dir += "/"; top_dir += cdup; - top_dir = cmSystemTools::CollapseFullPath(top_dir.c_str()); + top_dir = cmSystemTools::CollapseFullPath(top_dir); } return top_dir; } diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx index 0e29160..5b525dd 100644 --- a/Source/CTest/cmCTestHandlerCommand.cxx +++ b/Source/CTest/cmCTestHandlerCommand.cxx @@ -137,7 +137,7 @@ bool cmCTestHandlerCommand } std::string current_dir = cmSystemTools::GetCurrentWorkingDirectory(); cmSystemTools::ChangeDirectory( - this->CTest->GetCTestConfiguration("BuildDirectory").c_str()); + this->CTest->GetCTestConfiguration("BuildDirectory")); int res = handler->ProcessHandler(); if ( this->Values[ct_RETURN_VALUE] && *this->Values[ct_RETURN_VALUE]) { @@ -146,7 +146,7 @@ bool cmCTestHandlerCommand this->Makefile->AddDefinition( this->Values[ct_RETURN_VALUE], str.str().c_str()); } - cmSystemTools::ChangeDirectory(current_dir.c_str()); + cmSystemTools::ChangeDirectory(current_dir); return true; } diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index 10a5199..b65d23b 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -48,8 +48,8 @@ cmCTestLaunch::~cmCTestLaunch() cmsysProcess_Delete(this->Process); if(!this->Passthru) { - cmSystemTools::RemoveFile(this->LogOut.c_str()); - cmSystemTools::RemoveFile(this->LogErr.c_str()); + cmSystemTools::RemoveFile(this->LogOut); + cmSystemTools::RemoveFile(this->LogErr); } } @@ -434,8 +434,8 @@ void cmCTestLaunch::WriteXMLAction(std::ostream& fxml) // If file is in source tree use its relative location. if(cmSystemTools::FileIsFullPath(this->SourceDir.c_str()) && cmSystemTools::FileIsFullPath(source.c_str()) && - cmSystemTools::IsSubDirectory(source.c_str(), - this->SourceDir.c_str())) + cmSystemTools::IsSubDirectory(source, + this->SourceDir)) { source = cmSystemTools::RelativePath(this->SourceDir.c_str(), source.c_str()); diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 4835010..089e84b 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -1221,10 +1221,10 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res, } } cmSystemTools::Delay(1000); - cmSystemTools::RemoveFile(this->BoundsCheckerDPBDFile.c_str()); + cmSystemTools::RemoveFile(this->BoundsCheckerDPBDFile); cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Remove: " << this->BoundsCheckerDPBDFile << std::endl); - cmSystemTools::RemoveFile(this->BoundsCheckerXMLFile.c_str()); + cmSystemTools::RemoveFile(this->BoundsCheckerXMLFile); cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Remove: " << this->BoundsCheckerXMLFile << std::endl); } @@ -1255,7 +1255,7 @@ cmCTestMemCheckHandler::AppendMemTesterOutput(cmCTestTestResult& res, } if(this->LogWithPID) { - cmSystemTools::RemoveFile(ofile.c_str()); + cmSystemTools::RemoveFile(ofile); cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Remove: "<< ofile <<"\n"); } } diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 7ba434c..4c89caa 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -123,7 +123,7 @@ void cmCTestMultiProcessHandler::StartTestProcess(int test) testRun->SetTestProperties(this->Properties[test]); std::string current_dir = cmSystemTools::GetCurrentWorkingDirectory(); - cmSystemTools::ChangeDirectory(this->Properties[test]->Directory.c_str()); + cmSystemTools::ChangeDirectory(this->Properties[test]->Directory); // Lock the resources we'll be using this->LockResources(test); @@ -156,7 +156,7 @@ void cmCTestMultiProcessHandler::StartTestProcess(int test) this->Failed->push_back(this->Properties[test]->Name); delete testRun; } - cmSystemTools::ChangeDirectory(current_dir.c_str()); + cmSystemTools::ChangeDirectory(current_dir); } //--------------------------------------------------------- @@ -334,7 +334,7 @@ void cmCTestMultiProcessHandler::UpdateCostData() { if(line == "---") break; std::vector<cmsys::String> parts = - cmSystemTools::SplitString(line.c_str(), ' '); + cmSystemTools::SplitString(line, ' '); //Format: <name> <previous_runs> <avg_cost> if(parts.size() < 3) break; @@ -357,7 +357,7 @@ void cmCTestMultiProcessHandler::UpdateCostData() } } fin.close(); - cmSystemTools::RemoveFile(fname.c_str()); + cmSystemTools::RemoveFile(fname); } // Add all tests not previously listed in the file @@ -393,7 +393,7 @@ void cmCTestMultiProcessHandler::ReadCostData() if(line == "---") break; std::vector<cmsys::String> parts = - cmSystemTools::SplitString(line.c_str(), ' '); + cmSystemTools::SplitString(line, ' '); // Probably an older version of the file, will be fixed next run if(parts.size() < 3) @@ -621,7 +621,7 @@ void cmCTestMultiProcessHandler::MarkFinished() { std::string fname = this->CTest->GetBinaryDir() + "/Testing/Temporary/CTestCheckpoint.txt"; - cmSystemTools::RemoveFile(fname.c_str()); + cmSystemTools::RemoveFile(fname); } //--------------------------------------------------------- @@ -639,7 +639,7 @@ void cmCTestMultiProcessHandler::PrintTestList() //push working dir std::string current_dir = cmSystemTools::GetCurrentWorkingDirectory(); - cmSystemTools::ChangeDirectory(p.Directory.c_str()); + cmSystemTools::ChangeDirectory(p.Directory); cmCTestRunTest testRun(this->TestHandler); testRun.SetIndex(p.Index); @@ -676,7 +676,7 @@ void cmCTestMultiProcessHandler::PrintTestList() cmCTestLog(this->CTest, HANDLER_OUTPUT, " "); cmCTestLog(this->CTest, HANDLER_OUTPUT, p.Name.c_str() << std::endl); //pop working dir - cmSystemTools::ChangeDirectory(current_dir.c_str()); + cmSystemTools::ChangeDirectory(current_dir); } cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl << "Total Tests: " @@ -735,7 +735,7 @@ void cmCTestMultiProcessHandler::CheckResume() } else if(cmSystemTools::FileExists(fname.c_str(), true)) { - cmSystemTools::RemoveFile(fname.c_str()); + cmSystemTools::RemoveFile(fname); } } diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index bdd8c02..9e3c9fc 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -280,12 +280,12 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) // Set the working directory to the tests directory std::string oldpath = cmSystemTools::GetCurrentWorkingDirectory(); - cmSystemTools::ChangeDirectory(this->TestProperties->Directory.c_str()); + cmSystemTools::ChangeDirectory(this->TestProperties->Directory); this->DartProcessing(); // restore working directory - cmSystemTools::ChangeDirectory(oldpath.c_str()); + cmSystemTools::ChangeDirectory(oldpath); // if this is doing MemCheck then all the output needs to be put into diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index f050148..749eb58 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -184,7 +184,7 @@ int cmCTestScriptHandler::ProcessHandler() { // for each script run it res += this->RunConfigurationScript - (cmSystemTools::CollapseFullPath(this->ConfigurationScripts[i].c_str()), + (cmSystemTools::CollapseFullPath(this->ConfigurationScripts[i]), this->ScriptProcessScope[i]); } if ( res ) @@ -482,8 +482,8 @@ int cmCTestScriptHandler::ExtractVariables() = this->Makefile->GetSafeDefinition("CTEST_BINARY_DIRECTORY"); // add in translations for src and bin - cmSystemTools::AddKeepPath(this->SourceDir.c_str()); - cmSystemTools::AddKeepPath(this->BinaryDir.c_str()); + cmSystemTools::AddKeepPath(this->SourceDir); + cmSystemTools::AddKeepPath(this->BinaryDir); this->CTestCmd = this->Makefile->GetSafeDefinition("CTEST_COMMAND"); @@ -743,11 +743,11 @@ int cmCTestScriptHandler::BackupDirectories() // if for some reason those directories exist then first delete them if (cmSystemTools::FileExists(this->BackupSourceDir.c_str())) { - cmSystemTools::RemoveADirectory(this->BackupSourceDir.c_str()); + cmSystemTools::RemoveADirectory(this->BackupSourceDir); } if (cmSystemTools::FileExists(this->BackupBinaryDir.c_str())) { - cmSystemTools::RemoveADirectory(this->BackupBinaryDir.c_str()); + cmSystemTools::RemoveADirectory(this->BackupBinaryDir); } // first rename the src and binary directories @@ -991,8 +991,8 @@ int cmCTestScriptHandler::RunConfigurationDashboard() // if all was succesful, delete the backup dirs to free up disk space if (this->Backup) { - cmSystemTools::RemoveADirectory(this->BackupSourceDir.c_str()); - cmSystemTools::RemoveADirectory(this->BackupBinaryDir.c_str()); + cmSystemTools::RemoveADirectory(this->BackupSourceDir); + cmSystemTools::RemoveADirectory(this->BackupBinaryDir); } return 0; @@ -1033,11 +1033,11 @@ void cmCTestScriptHandler::RestoreBackupDirectories() // if for some reason those directories exist then first delete them if (cmSystemTools::FileExists(this->SourceDir.c_str())) { - cmSystemTools::RemoveADirectory(this->SourceDir.c_str()); + cmSystemTools::RemoveADirectory(this->SourceDir); } if (cmSystemTools::FileExists(this->BinaryDir.c_str())) { - cmSystemTools::RemoveADirectory(this->BinaryDir.c_str()); + cmSystemTools::RemoveADirectory(this->BinaryDir); } // rename the src and binary directories rename(this->BackupSourceDir.c_str(), this->SourceDir.c_str()); @@ -1100,7 +1100,7 @@ bool cmCTestScriptHandler::TryToRemoveBinaryDirectoryOnce( const std::string& directoryPath) { cmsys::Directory directory; - directory.Load(directoryPath.c_str()); + directory.Load(directoryPath); for(unsigned long i = 0; i < directory.GetNumberOfFiles(); ++i) { @@ -1113,26 +1113,26 @@ bool cmCTestScriptHandler::TryToRemoveBinaryDirectoryOnce( std::string fullPath = directoryPath + std::string("/") + path; - bool isDirectory = cmSystemTools::FileIsDirectory(fullPath.c_str()) && - !cmSystemTools::FileIsSymlink(fullPath.c_str()); + bool isDirectory = cmSystemTools::FileIsDirectory(fullPath) && + !cmSystemTools::FileIsSymlink(fullPath); if(isDirectory) { - if(!cmSystemTools::RemoveADirectory(fullPath.c_str())) + if(!cmSystemTools::RemoveADirectory(fullPath)) { return false; } } else { - if(!cmSystemTools::RemoveFile(fullPath.c_str())) + if(!cmSystemTools::RemoveFile(fullPath)) { return false; } } } - return cmSystemTools::RemoveADirectory(directoryPath.c_str()); + return cmSystemTools::RemoveADirectory(directoryPath); } //------------------------------------------------------------------------- diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx index da46f4a..1a39a8a 100644 --- a/Source/CTest/cmCTestStartCommand.cxx +++ b/Source/CTest/cmCTestStartCommand.cxx @@ -124,7 +124,7 @@ bool cmCTestStartCommand { return false; } - if(!cmSystemTools::FileIsDirectory(sourceDir.c_str())) + if(!cmSystemTools::FileIsDirectory(sourceDir)) { cmOStringStream e; e << "given source path\n" diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 06fcb75..5f065c2 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -236,7 +236,7 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix, } unsigned long filelen = cmSystemTools::FileLength(local_file.c_str()); - ftpfile = cmsys::SystemTools::Fopen(local_file.c_str(), "rb"); + ftpfile = cmsys::SystemTools::Fopen(local_file, "rb"); *this->LogFile << "\tUpload file: " << local_file << " to " << upload_as << std::endl; cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Upload file: " @@ -477,7 +477,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, } unsigned long filelen = cmSystemTools::FileLength(local_file.c_str()); - ftpfile = cmsys::SystemTools::Fopen(local_file.c_str(), "rb"); + ftpfile = cmsys::SystemTools::Fopen(local_file, "rb"); cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Upload file: " << local_file << " to " << upload_as << " Size: " << filelen << std::endl); @@ -567,7 +567,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, << count << std::endl); ::fclose(ftpfile); - ftpfile = cmsys::SystemTools::Fopen(local_file.c_str(), "rb"); + ftpfile = cmsys::SystemTools::Fopen(local_file, "rb"); ::curl_easy_setopt(curl, CURLOPT_INFILE, ftpfile); chunk.clear(); @@ -931,13 +931,13 @@ bool cmCTestSubmitHandler::SubmitUsingCP( cmSystemTools::ConvertToUnixSlashes(lfname); lfname += "/" + *file; std::string rfname = destination + "/" + remoteprefix + *file; - cmSystemTools::CopyFileAlways(lfname.c_str(), rfname.c_str()); + cmSystemTools::CopyFileAlways(lfname, rfname); cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Copy file: " << lfname << " to " << rfname << std::endl); } std::string tagDoneFile = destination + "/" + remoteprefix + "DONE"; - cmSystemTools::Touch(tagDoneFile.c_str(), true); + cmSystemTools::Touch(tagDoneFile, true); if ( problems ) { return false; @@ -1418,20 +1418,20 @@ int cmCTestSubmitHandler::ProcessHandler() // change to the build directory so that we can uses a relative path // on windows since scp dosn't support "c:" a drive in the path oldWorkingDirectory = cmSystemTools::GetCurrentWorkingDirectory(); - cmSystemTools::ChangeDirectory(buildDirectory.c_str()); + cmSystemTools::ChangeDirectory(buildDirectory); if ( !this->SubmitUsingSCP( this->CTest->GetCTestConfiguration("ScpCommand"), "Testing/"+this->CTest->GetCurrentTag(), files, prefix, url) ) { - cmSystemTools::ChangeDirectory(oldWorkingDirectory.c_str()); + cmSystemTools::ChangeDirectory(oldWorkingDirectory); cmCTestLog(this->CTest, ERROR_MESSAGE, " Problems when submitting via SCP" << std::endl); ofs << " Problems when submitting via SCP" << std::endl; return -1; } - cmSystemTools::ChangeDirectory(oldWorkingDirectory.c_str()); + cmSystemTools::ChangeDirectory(oldWorkingDirectory); cmCTestLog(this->CTest, HANDLER_OUTPUT, " Submission successful" << std::endl); ofs << " Submission successful" << std::endl; @@ -1447,7 +1447,7 @@ int cmCTestSubmitHandler::ProcessHandler() // on windows since scp dosn't support "c:" a drive in the path std::string oldWorkingDirectory = cmSystemTools::GetCurrentWorkingDirectory(); - cmSystemTools::ChangeDirectory(buildDirectory.c_str()); + cmSystemTools::ChangeDirectory(buildDirectory); cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Change directory: " << buildDirectory << std::endl); @@ -1457,14 +1457,14 @@ int cmCTestSubmitHandler::ProcessHandler() prefix, location) ) { - cmSystemTools::ChangeDirectory(oldWorkingDirectory.c_str()); + cmSystemTools::ChangeDirectory(oldWorkingDirectory); cmCTestLog(this->CTest, ERROR_MESSAGE, " Problems when submitting via CP" << std::endl); ofs << " Problems when submitting via cp" << std::endl; return -1; } - cmSystemTools::ChangeDirectory(oldWorkingDirectory.c_str()); + cmSystemTools::ChangeDirectory(oldWorkingDirectory); cmCTestLog(this->CTest, HANDLER_OUTPUT, " Submission successful" << std::endl); ofs << " Submission successful" << std::endl; diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index f21d166..435fb32 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -93,12 +93,12 @@ bool cmCTestSubdirCommand fname += *it; } - if ( !cmSystemTools::FileIsDirectory(fname.c_str()) ) + if ( !cmSystemTools::FileIsDirectory(fname) ) { // No subdirectory? So what... continue; } - cmSystemTools::ChangeDirectory(fname.c_str()); + cmSystemTools::ChangeDirectory(fname); const char* testFilename; if( cmSystemTools::FileExists("CTestTestfile.cmake") ) { @@ -120,7 +120,7 @@ bool cmCTestSubdirCommand bool readit = this->Makefile->ReadListFile(this->Makefile->GetCurrentListFile(), fname.c_str()); - cmSystemTools::ChangeDirectory(cwd.c_str()); + cmSystemTools::ChangeDirectory(cwd); if(!readit) { std::string m = "Could not find include file: "; @@ -129,7 +129,7 @@ bool cmCTestSubdirCommand return false; } } - cmSystemTools::ChangeDirectory(cwd.c_str()); + cmSystemTools::ChangeDirectory(cwd); return true; } @@ -175,7 +175,7 @@ bool cmCTestAddSubdirectoryCommand } std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); - cmSystemTools::ChangeDirectory(cwd.c_str()); + cmSystemTools::ChangeDirectory(cwd); std::string fname = cwd; fname += "/"; fname += args[1]; @@ -185,7 +185,7 @@ bool cmCTestAddSubdirectoryCommand // No subdirectory? So what... return true; } - cmSystemTools::ChangeDirectory(fname.c_str()); + cmSystemTools::ChangeDirectory(fname); const char* testFilename; if( cmSystemTools::FileExists("CTestTestfile.cmake") ) { @@ -200,7 +200,7 @@ bool cmCTestAddSubdirectoryCommand else { // No CTestTestfile? Who cares... - cmSystemTools::ChangeDirectory(cwd.c_str()); + cmSystemTools::ChangeDirectory(cwd); return true; } fname += "/"; @@ -208,7 +208,7 @@ bool cmCTestAddSubdirectoryCommand bool readit = this->Makefile->ReadListFile(this->Makefile->GetCurrentListFile(), fname.c_str()); - cmSystemTools::ChangeDirectory(cwd.c_str()); + cmSystemTools::ChangeDirectory(cwd); if(!readit) { std::string m = "Could not find include file: "; @@ -1498,9 +1498,9 @@ std::string cmCTestTestHandler { // first check without exe extension if(cmSystemTools::FileExists(attempted[ai].c_str()) - && !cmSystemTools::FileIsDirectory(attempted[ai].c_str())) + && !cmSystemTools::FileIsDirectory(attempted[ai])) { - fullPath = cmSystemTools::CollapseFullPath(attempted[ai].c_str()); + fullPath = cmSystemTools::CollapseFullPath(attempted[ai]); resultingConfig = attemptedConfigs[ai]; } // then try with the exe extension @@ -1510,9 +1510,9 @@ std::string cmCTestTestHandler tempPath = attempted[ai]; tempPath += cmSystemTools::GetExecutableExtension(); if(cmSystemTools::FileExists(tempPath.c_str()) - && !cmSystemTools::FileIsDirectory(tempPath.c_str())) + && !cmSystemTools::FileIsDirectory(tempPath)) { - fullPath = cmSystemTools::CollapseFullPath(tempPath.c_str()); + fullPath = cmSystemTools::CollapseFullPath(tempPath); resultingConfig = attemptedConfigs[ai]; } else @@ -1746,7 +1746,7 @@ void cmCTestTestHandler::ExpandTestsToRunInformationForRerunFailed() std::string dirName = this->CTest->GetBinaryDir() + "/Testing/Temporary"; cmsys::Directory directory; - if (directory.Load(dirName.c_str()) == 0) + if (directory.Load(dirName) == 0) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Unable to read the contents of " << dirName << std::endl); @@ -1754,7 +1754,7 @@ void cmCTestTestHandler::ExpandTestsToRunInformationForRerunFailed() } int numFiles = static_cast<int> - (cmsys::Directory::GetNumberOfFilesInDirectory(dirName.c_str())); + (cmsys::Directory::GetNumberOfFilesInDirectory(dirName)); std::string pattern = "LastTestsFailed"; std::string logName = ""; @@ -1777,7 +1777,7 @@ void cmCTestTestHandler::ExpandTestsToRunInformationForRerunFailed() // if multiple matching logs were found we use the most recently // modified one. int res; - cmSystemTools::FileTimeCompare(logName.c_str(), fileName.c_str(), &res); + cmSystemTools::FileTimeCompare(logName, fileName, &res); if (res == -1) { logName = fileName; diff --git a/Source/CTest/cmParseCacheCoverage.cxx b/Source/CTest/cmParseCacheCoverage.cxx index d17f169..97454a8 100644 --- a/Source/CTest/cmParseCacheCoverage.cxx +++ b/Source/CTest/cmParseCacheCoverage.cxx @@ -31,7 +31,7 @@ bool cmParseCacheCoverage::LoadCoverageData(const char* d) { std::string file = dir.GetFile(i); if(file != "." && file != ".." - && !cmSystemTools::FileIsDirectory(file.c_str())) + && !cmSystemTools::FileIsDirectory(file)) { std::string path = d; path += "/"; diff --git a/Source/CTest/cmParseGTMCoverage.cxx b/Source/CTest/cmParseGTMCoverage.cxx index be10c2e..d77244a 100644 --- a/Source/CTest/cmParseGTMCoverage.cxx +++ b/Source/CTest/cmParseGTMCoverage.cxx @@ -30,7 +30,7 @@ bool cmParseGTMCoverage::LoadCoverageData(const char* d) { std::string file = dir.GetFile(i); if(file != "." && file != ".." - && !cmSystemTools::FileIsDirectory(file.c_str())) + && !cmSystemTools::FileIsDirectory(file)) { std::string path = d; path += "/"; diff --git a/Source/CTest/cmParsePHPCoverage.cxx b/Source/CTest/cmParsePHPCoverage.cxx index 3b7f968..c7f5a68 100644 --- a/Source/CTest/cmParsePHPCoverage.cxx +++ b/Source/CTest/cmParsePHPCoverage.cxx @@ -239,7 +239,7 @@ bool cmParsePHPCoverage::ReadPHPCoverageDirectory(const char* d) { std::string file = dir.GetFile(i); if(file != "." && file != ".." - && !cmSystemTools::FileIsDirectory(file.c_str())) + && !cmSystemTools::FileIsDirectory(file)) { std::string path = d; path += "/"; |