summaryrefslogtreecommitdiffstats
path: root/Source/cmTestGenerator.cxx
diff options
context:
space:
mode:
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.