summaryrefslogtreecommitdiffstats
path: root/Source/cmAddTestCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-03-16 14:42:40 (GMT)
committerBrad King <brad.king@kitware.com>2009-03-16 14:42:40 (GMT)
commit606e6ff9cd2d1ab6a242a38e0c3f6df7167fdff8 (patch)
tree91610453e4195269742ff173dda93e53c8e19e3d /Source/cmAddTestCommand.cxx
parent66d69f864ae880f556debf02e66dee4855b0f2df (diff)
downloadCMake-606e6ff9cd2d1ab6a242a38e0c3f6df7167fdff8.zip
CMake-606e6ff9cd2d1ab6a242a38e0c3f6df7167fdff8.tar.gz
CMake-606e6ff9cd2d1ab6a242a38e0c3f6df7167fdff8.tar.bz2
ENH: Refactor storage of test command lines
We used to separate the command executable from its argument vector. It is simpler to just store the whole command line in one vector.
Diffstat (limited to 'Source/cmAddTestCommand.cxx')
-rw-r--r--Source/cmAddTestCommand.cxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx
index 0bbf40e..e894bd8 100644
--- a/Source/cmAddTestCommand.cxx
+++ b/Source/cmAddTestCommand.cxx
@@ -33,15 +33,13 @@ bool cmAddTestCommand
this->SetError("called with incorrect number of arguments");
return false;
}
-
- // store the arguments for the final pass
- // also expand any CMake variables
- std::vector<cmStdString> arguments;
- std::vector<std::string>::const_iterator it;
- for ( it = args.begin() + 2; it != args.end(); ++ it )
+ // Collect the command with arguments.
+ std::vector<std::string> command;
+ for(std::vector<std::string>::const_iterator it = args.begin() + 1;
+ it != args.end(); ++it)
{
- arguments.push_back(*it);
+ command.push_back(*it);
}
// Create the test but add a generator only the first time it is
@@ -52,8 +50,7 @@ bool cmAddTestCommand
test = this->Makefile->CreateTest(args[0].c_str());
this->Makefile->AddTestGenerator(new cmTestGenerator(test));
}
- test->SetCommand(args[1].c_str());
- test->SetArguments(arguments);
+ test->SetCommand(command);
return true;
}