summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestScriptHandler.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-01-27 16:43:22 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-01-27 16:43:22 (GMT)
commitdc0ce24cc6bdd4e59e3fef79fd1bbdfcae82be70 (patch)
tree4b1e28c5e4accd116056be7d243400f16f0ce7d9 /Source/CTest/cmCTestScriptHandler.cxx
parentbf3d7746458af539536a1438c88608897be71ce2 (diff)
downloadCMake-dc0ce24cc6bdd4e59e3fef79fd1bbdfcae82be70.zip
CMake-dc0ce24cc6bdd4e59e3fef79fd1bbdfcae82be70.tar.gz
CMake-dc0ce24cc6bdd4e59e3fef79fd1bbdfcae82be70.tar.bz2
ENH: Add a superclass to all handlers
Diffstat (limited to 'Source/CTest/cmCTestScriptHandler.cxx')
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx25
1 files changed, 12 insertions, 13 deletions
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 410d11d..f197722 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -125,7 +125,7 @@ void cmCTestScriptHandler::AddConfigurationScript(const char *script)
//----------------------------------------------------------------------
// the generic entry point for handling scripts, this routine will run all
// the scripts provides a -S arguments
-int cmCTestScriptHandler::RunConfigurationScript(cmCTest* ctest)
+int cmCTestScriptHandler::RunConfigurationScript()
{
int res = 0;
std::vector<cmStdString>::iterator it;
@@ -134,7 +134,7 @@ int cmCTestScriptHandler::RunConfigurationScript(cmCTest* ctest)
it ++ )
{
// for each script run it
- res += this->RunConfigurationScript(ctest,
+ res += this->RunConfigurationScript(
cmSystemTools::CollapseFullPath(it->c_str()));
}
return res;
@@ -157,8 +157,7 @@ void cmCTestScriptHandler::UpdateElapsedTime()
//----------------------------------------------------------------------
// this sets up some variables for thew script to use, creates the required
// cmake instance and generators, and then reads in the script
-int cmCTestScriptHandler::ReadInScript(cmCTest* ctest,
- const std::string& total_script_arg)
+int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
{
// if the argument has a , in it then it needs to be broken into the fist
// argument (which is the script) and the second argument which will be
@@ -201,7 +200,7 @@ int cmCTestScriptHandler::ReadInScript(cmCTest* ctest,
cmSystemTools::GetFilenameName(
script).c_str());
m_LocalGenerator->GetMakefile()->AddDefinition("CTEST_EXECUTABLE_NAME",
- ctest->GetCTestExecutable());
+ m_CTest->GetCTestExecutable());
this->UpdateElapsedTime();
@@ -209,15 +208,15 @@ int cmCTestScriptHandler::ReadInScript(cmCTest* ctest,
// for ctest commands to clean this up. If a couple more commands are
// created with the same format lets do that - ken
cmCTestCommand* newCom = new cmCTestRunScriptCommand;
- newCom->m_CTest = ctest;
+ newCom->m_CTest = m_CTest;
newCom->m_CTestScriptHandler = this;
m_CMake->AddCommand(newCom);
newCom = new cmCTestEmptyBinaryDirectoryCommand;
- newCom->m_CTest = ctest;
+ newCom->m_CTest = m_CTest;
newCom->m_CTestScriptHandler = this;
m_CMake->AddCommand(newCom);
newCom = new cmCTestSleepCommand;
- newCom->m_CTest = ctest;
+ newCom->m_CTest = m_CTest;
newCom->m_CTestScriptHandler = this;
m_CMake->AddCommand(newCom);
@@ -349,8 +348,7 @@ void cmCTestScriptHandler::SleepInSeconds(unsigned int secondsToWait)
//----------------------------------------------------------------------
// run a specific script
-int cmCTestScriptHandler::RunConfigurationScript(cmCTest* ctest,
- const std::string& total_script_arg)
+int cmCTestScriptHandler::RunConfigurationScript(const std::string& total_script_arg)
{
int result;
@@ -358,7 +356,7 @@ int cmCTestScriptHandler::RunConfigurationScript(cmCTest* ctest,
cmSystemTools::GetTime();
// read in the script
- result = this->ReadInScript(ctest, total_script_arg);
+ result = this->ReadInScript(total_script_arg);
if (result)
{
return result;
@@ -761,11 +759,12 @@ void cmCTestScriptHandler::RestoreBackupDirectories()
}
}
-bool cmCTestScriptHandler::RunScript(cmCTest *ctest, const char *sname)
+bool cmCTestScriptHandler::RunScript(cmCTest* ctest, const char *sname)
{
cmCTestScriptHandler* sh = new cmCTestScriptHandler();
+ sh->SetCTestInstance(ctest);
sh->AddConfigurationScript(sname);
- sh->RunConfigurationScript(ctest);
+ sh->RunConfigurationScript();
delete sh;
return true;
}