summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestBatchTestHandler.cxx
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2016-05-16 14:34:04 (GMT)
committerBrad King <brad.king@kitware.com>2016-05-16 20:05:19 (GMT)
commitd9fd2f5402eeaa345691313658e02b51038f570b (patch)
treedca71b9a7e267f4c6300da3eb770415381726785 /Source/CTest/cmCTestBatchTestHandler.cxx
parent82df6deaafb36cbbfd450202bb20b320f637751a (diff)
downloadCMake-d9fd2f5402eeaa345691313658e02b51038f570b.zip
CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.gz
CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.bz2
Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
Diffstat (limited to 'Source/CTest/cmCTestBatchTestHandler.cxx')
-rw-r--r--Source/CTest/cmCTestBatchTestHandler.cxx62
1 files changed, 27 insertions, 35 deletions
diff --git a/Source/CTest/cmCTestBatchTestHandler.cxx b/Source/CTest/cmCTestBatchTestHandler.cxx
index 6127551..386c8d5 100644
--- a/Source/CTest/cmCTestBatchTestHandler.cxx
+++ b/Source/CTest/cmCTestBatchTestHandler.cxx
@@ -30,18 +30,17 @@ void cmCTestBatchTestHandler::RunTests()
void cmCTestBatchTestHandler::WriteBatchScript()
{
- this->Script = this->CTest->GetBinaryDir()
- + "/Testing/CTestBatch.txt";
+ this->Script = this->CTest->GetBinaryDir() + "/Testing/CTestBatch.txt";
cmsys::ofstream fout;
fout.open(this->Script.c_str());
fout << "#!/bin/sh\n";
- for(TestMap::iterator i = this->Tests.begin(); i != this->Tests.end(); ++i)
- {
+ for (TestMap::iterator i = this->Tests.begin(); i != this->Tests.end();
+ ++i) {
this->WriteSrunArgs(i->first, fout);
this->WriteTestCommand(i->first, fout);
fout << "\n";
- }
+ }
fout.flush();
fout.close();
}
@@ -49,13 +48,13 @@ void cmCTestBatchTestHandler::WriteBatchScript()
void cmCTestBatchTestHandler::WriteSrunArgs(int test, cmsys::ofstream& fout)
{
cmCTestTestHandler::cmCTestTestProperties* properties =
- this->Properties[test];
+ this->Properties[test];
fout << "srun ";
- //fout << "--jobid=" << test << " ";
+ // fout << "--jobid=" << test << " ";
fout << "-J=" << properties->Name << " ";
- //Write dependency information
+ // Write dependency information
/*if(!this->Tests[test].empty())
{
fout << "-P=afterany";
@@ -66,14 +65,12 @@ void cmCTestBatchTestHandler::WriteSrunArgs(int test, cmsys::ofstream& fout)
}
fout << " ";
}*/
- if(properties->RunSerial)
- {
+ if (properties->RunSerial) {
fout << "--exclusive ";
- }
- if(properties->Processors > 1)
- {
+ }
+ if (properties->Processors > 1) {
fout << "-n" << properties->Processors << " ";
- }
+ }
}
void cmCTestBatchTestHandler::WriteTestCommand(int test, cmsys::ofstream& fout)
@@ -85,36 +82,32 @@ void cmCTestBatchTestHandler::WriteTestCommand(int test, cmsys::ofstream& fout)
command = this->TestHandler->FindTheExecutable(args[1].c_str());
command = cmSystemTools::ConvertToOutputPath(command.c_str());
- //Prepends memcheck args to our command string if this is a memcheck
+ // Prepends memcheck args to our command string if this is a memcheck
this->TestHandler->GenerateTestCommand(processArgs, test);
processArgs.push_back(command);
- for(std::vector<std::string>::iterator arg = processArgs.begin();
- arg != processArgs.end(); ++arg)
- {
+ for (std::vector<std::string>::iterator arg = processArgs.begin();
+ arg != processArgs.end(); ++arg) {
fout << *arg << " ";
- }
+ }
std::vector<std::string>::iterator i = args.begin();
- ++i; //the test name
- ++i; //the executable (command)
- if(args.size() > 2)
- {
+ ++i; // the test name
+ ++i; // the executable (command)
+ if (args.size() > 2) {
fout << "'";
- }
- while(i != args.end())
- {
- fout << "\"" << *i << "\""; //args to the test executable
+ }
+ while (i != args.end()) {
+ fout << "\"" << *i << "\""; // args to the test executable
++i;
- if(i == args.end() && args.size() > 2)
- {
+ if (i == args.end() && args.size() > 2) {
fout << "'";
- }
- fout << " ";
}
- //TODO ZACH build TestResult.FullCommandLine
- //this->TestResult.FullCommandLine = this->TestCommand;
+ fout << " ";
+ }
+ // TODO ZACH build TestResult.FullCommandLine
+ // this->TestResult.FullCommandLine = this->TestCommand;
}
void cmCTestBatchTestHandler::SubmitBatchScript()
@@ -123,8 +116,7 @@ void cmCTestBatchTestHandler::SubmitBatchScript()
std::vector<std::string> args;
args.push_back(this->Script);
args.push_back("-o");
- args.push_back(this->CTest->GetBinaryDir()
- + "/Testing/CTestBatch.txt");
+ args.push_back(this->CTest->GetBinaryDir() + "/Testing/CTestBatch.txt");
sbatch.SetCommand("sbatch");
sbatch.SetCommandArguments(args);