summaryrefslogtreecommitdiffstats
path: root/Source/cmTestGenerator.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/cmTestGenerator.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/cmTestGenerator.cxx')
-rw-r--r--Source/cmTestGenerator.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index 75865a2..8581c96 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -16,6 +16,7 @@
=========================================================================*/
#include "cmTestGenerator.h"
+#include "cmSystemTools.h"
#include "cmTest.h"
//----------------------------------------------------------------------------
@@ -96,14 +97,17 @@ void cmTestGenerator::GenerateScriptActions(std::ostream& fout,
{
this->TestGenerated = true;
- cmTest* test = this->Test;
+ // Get the test command line to be executed.
+ std::vector<std::string> const& command = this->Test->GetCommand();
+
+ std::string exe = command[0];
+ cmSystemTools::ConvertToUnixSlashes(exe);
fout << indent;
fout << "ADD_TEST(";
- fout << test->GetName() << " \"" << test->GetCommand() << "\"";
+ fout << this->Test->GetName() << " \"" << exe << "\"";
- std::vector<cmStdString>::const_iterator argit;
- for (argit = test->GetArguments().begin();
- argit != test->GetArguments().end(); ++argit)
+ for(std::vector<std::string>::const_iterator argit = command.begin()+1;
+ argit != command.end(); ++argit)
{
// Just double-quote all arguments so they are re-parsed
// correctly by the test system.