diff options
Diffstat (limited to 'Source/CTest/cmCTestScriptHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestScriptHandler.cxx | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 6fd24a5..7d1c24f 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -245,10 +245,9 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) std::ostringstream message; message << "Error running command: ["; message << result << "] "; - for (std::vector<const char*>::iterator i = argv.begin(); i != argv.end(); - ++i) { - if (*i) { - message << *i << " "; + for (const char* arg : argv) { + if (arg) { + message << arg << " "; } } cmCTestLog(this->CTest, ERROR_MESSAGE, message.str() << argv[0] @@ -377,9 +376,8 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg) // Add definitions of variables passed in on the command line: const std::map<std::string, std::string>& defs = this->CTest->GetDefinitions(); - for (std::map<std::string, std::string>::const_iterator it = defs.begin(); - it != defs.end(); ++it) { - this->Makefile->AddDefinition(it->first, it->second.c_str()); + for (auto const& d : defs) { + this->Makefile->AddDefinition(d.first, d.second.c_str()); } // finally read in the script @@ -654,10 +652,9 @@ int cmCTestScriptHandler::PerformExtraUpdates() // do an initial cvs update as required command = this->UpdateCmd; - std::vector<std::string>::iterator it; - for (it = this->ExtraUpdates.begin(); it != this->ExtraUpdates.end(); ++it) { + for (std::string const& eu : this->ExtraUpdates) { std::vector<std::string> cvsArgs; - cmSystemTools::ExpandListArgument(*it, cvsArgs); + cmSystemTools::ExpandListArgument(eu, cvsArgs); if (cvsArgs.size() == 2) { std::string fullCommand = command; fullCommand += " update "; @@ -670,7 +667,7 @@ int cmCTestScriptHandler::PerformExtraUpdates() fullCommand.c_str(), &output, &output, &retVal, cvsArgs[0].c_str(), this->HandlerVerbose, 0 /*this->TimeOut*/); if (!res || retVal != 0) { - cmSystemTools::Error("Unable to perform extra updates:\n", it->c_str(), + cmSystemTools::Error("Unable to perform extra updates:\n", eu.c_str(), "\nWith output:\n", output.c_str()); return 0; } @@ -803,8 +800,8 @@ int cmCTestScriptHandler::RunConfigurationDashboard() std::vector<std::string> ctestCommands; cmSystemTools::ExpandListArgument(this->CTestCmd, ctestCommands); // for each variable/argument do a putenv - for (unsigned i = 0; i < ctestCommands.size(); ++i) { - command = ctestCommands[i]; + for (std::string const& ctestCommand : ctestCommands) { + command = ctestCommand; output = ""; retVal = 0; cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, |