summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestTestCommand.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-06-23 17:04:18 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-06-23 17:04:18 (GMT)
commit1b578d3180ce60976e4cbe928fce988acfd0da39 (patch)
treecdefbf878667d466318aeabfa77cc7625cb4777e /Source/CTest/cmCTestTestCommand.cxx
parent5c68b61a9caab3f89031155d129b9498d840e502 (diff)
downloadCMake-1b578d3180ce60976e4cbe928fce988acfd0da39.zip
CMake-1b578d3180ce60976e4cbe928fce988acfd0da39.tar.gz
CMake-1b578d3180ce60976e4cbe928fce988acfd0da39.tar.bz2
ENH: Several improvements with the way things are handled. Also, support multiple submited files
Diffstat (limited to 'Source/CTest/cmCTestTestCommand.cxx')
-rw-r--r--Source/CTest/cmCTestTestCommand.cxx85
1 files changed, 26 insertions, 59 deletions
diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx
index 38b7051..6be718c 100644
--- a/Source/CTest/cmCTestTestCommand.cxx
+++ b/Source/CTest/cmCTestTestCommand.cxx
@@ -19,75 +19,42 @@
#include "cmCTest.h"
#include "cmCTestGenericHandler.h"
-bool cmCTestTestCommand::InitialPass(
- std::vector<std::string> const& args)
+cmCTestTestCommand::cmCTestTestCommand()
{
- const char* build_dir = 0;
- const char* res_var = 0;
+ m_Arguments[ctt_START] = "START";
+ m_Arguments[ctt_END] = "END";
+ m_Arguments[ctt_STRIDE] = "STRIDE";
+ m_Arguments[ctt_LAST] = 0;
+ m_Last = ctt_LAST;
+}
- bool havereturn_variable = false;
- bool havesource = false;
- for(size_t i=0; i < args.size(); ++i)
+cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
+{
+ cmCTestGenericHandler* handler = m_CTest->GetInitializedHandler("test");
+ if ( m_Values[ctt_START] || m_Values[ctt_END] || m_Values[ctt_STRIDE] )
{
- if ( havereturn_variable )
- {
- res_var = args[i].c_str();
- havereturn_variable = false;
- }
- else if ( havesource )
+ cmOStringStream testsToRunString;
+ if ( m_Values[ctt_START] )
{
- build_dir = args[i].c_str();
- havesource = false;
+ testsToRunString << m_Values[ctt_START];
}
- else if(args[i] == "RETURN_VALUE")
+ testsToRunString << ",";
+ if ( m_Values[ctt_END] )
{
- if ( res_var )
- {
- this->SetError("called with incorrect number of arguments. RETURN_VALUE specified twice.");
- return false;
- }
- havereturn_variable = true;
- }
- else if(args[i] == "BUILD")
- {
- if ( build_dir )
- {
- this->SetError("called with incorrect number of arguments. BUILD specified twice.");
- return false;
- }
- havesource = true;
+ testsToRunString << m_Values[ctt_END];
}
- else
+ testsToRunString << ",";
+ if ( m_Values[ctt_STRIDE] )
{
- cmOStringStream str;
- str << "called with incorrect number of arguments. Extra argument is: " << args[i].c_str() << ".";
- this->SetError(str.str().c_str());
- return false;
+ testsToRunString << m_Values[ctt_STRIDE];
}
+ handler->SetOption("TestsToRunInformation", testsToRunString.str().c_str());
}
-
- if ( build_dir )
- {
- m_CTest->SetCTestConfiguration("BuildDirectory", build_dir);
- }
-
- cmCTestGenericHandler* handler = m_CTest->GetHandler("test");
- if ( !handler )
- {
- this->SetError("internal CTest error. Cannot instantiate test handler");
- return false;
- }
- std::string current_dir = cmSystemTools::GetCurrentWorkingDirectory();
- cmSystemTools::ChangeDirectory(m_CTest->GetCTestConfiguration("BuildDirectory").c_str());
- int res = handler->ProcessHandler();
- if ( res_var )
- {
- cmOStringStream str;
- str << res;
- m_Makefile->AddDefinition(res_var, str.str().c_str());
- }
- cmSystemTools::ChangeDirectory(current_dir.c_str());
- return true;
+ return handler;
}
+cmCTestGenericHandler* cmCTestTestCommand::InitializeActualHandler()
+{
+ return m_CTest->GetInitializedHandler("test");
+}