summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-06-08 20:06:33 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-06-08 20:06:33 (GMT)
commite37f8e2964e8415892eb31dce4c462173e95f69f (patch)
tree71aa497bb50233407b22d7c318aee1b18285c815 /Source/CTest
parentd1c4a0bf9ee0851a576aea6af72b20222144f830 (diff)
downloadCMake-e37f8e2964e8415892eb31dce4c462173e95f69f.zip
CMake-e37f8e2964e8415892eb31dce4c462173e95f69f.tar.gz
CMake-e37f8e2964e8415892eb31dce4c462173e95f69f.tar.bz2
STYLE: create command documentation for ctest
I think some of the cmake commands should be removed from ctest if possible, like add_executable etc. Alex
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx73
-rw-r--r--Source/CTest/cmCTestScriptHandler.h3
2 files changed, 45 insertions, 31 deletions
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 0346e43..e8d4029 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -283,6 +283,46 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg)
return retVal;
}
+void cmCTestScriptHandler::CreateCMake()
+{
+ // create a cmake instance to read the configuration script
+ if (this->CMake)
+ {
+ delete this->CMake;
+ delete this->GlobalGenerator;
+ delete this->LocalGenerator;
+ }
+ this->CMake = new cmake;
+ this->CMake->AddCMakePaths(this->CTest->GetCTestExecutable());
+ this->GlobalGenerator = new cmGlobalGenerator;
+ this->GlobalGenerator->SetCMakeInstance(this->CMake);
+
+ this->LocalGenerator = this->GlobalGenerator->CreateLocalGenerator();
+ this->LocalGenerator->SetGlobalGenerator(this->GlobalGenerator);
+ this->Makefile = this->LocalGenerator->GetMakefile();
+
+
+ // add any ctest specific commands, probably should have common superclass
+ // for ctest commands to clean this up. If a couple more commands are
+ // created with the same format lets do that - ken
+ this->AddCTestCommand(new cmCTestBuildCommand);
+ this->AddCTestCommand(new cmCTestConfigureCommand);
+ this->AddCTestCommand(new cmCTestCoverageCommand);
+ this->AddCTestCommand(new cmCTestEmptyBinaryDirectoryCommand);
+ this->AddCTestCommand(new cmCTestMemCheckCommand);
+ this->AddCTestCommand(new cmCTestReadCustomFilesCommand);
+ this->AddCTestCommand(new cmCTestRunScriptCommand);
+ this->AddCTestCommand(new cmCTestSleepCommand);
+ this->AddCTestCommand(new cmCTestStartCommand);
+ this->AddCTestCommand(new cmCTestSubmitCommand);
+ this->AddCTestCommand(new cmCTestTestCommand);
+ this->AddCTestCommand(new cmCTestUpdateCommand);
+}
+
+void cmCTestScriptHandler::GetCommandDocumentation(std::vector<cmDocumentationEntry>& v) const
+{
+ this->CMake->GetCommandDocumentation(v);
+}
//----------------------------------------------------------------------
// this sets up some variables for the script to use, creates the required
@@ -307,22 +347,9 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
return 1;
}
- // create a cmake instance to read the configuration script
// read in the list file to fill the cache
- if (this->CMake)
- {
- delete this->CMake;
- delete this->GlobalGenerator;
- delete this->LocalGenerator;
- }
- this->CMake = new cmake;
- this->CMake->AddCMakePaths(this->CTest->GetCTestExecutable());
- this->GlobalGenerator = new cmGlobalGenerator;
- this->GlobalGenerator->SetCMakeInstance(this->CMake);
-
- this->LocalGenerator = this->GlobalGenerator->CreateLocalGenerator();
- this->LocalGenerator->SetGlobalGenerator(this->GlobalGenerator);
- this->Makefile = this->LocalGenerator->GetMakefile();
+ // create a cmake instance to read the configuration script
+ this->CreateCMake();
// set a variable with the path to the current script
this->Makefile->AddDefinition("CTEST_SCRIPT_DIRECTORY",
@@ -336,22 +363,6 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
this->Makefile->AddDefinition("CTEST_RUN_CURRENT_SCRIPT", true);
this->UpdateElapsedTime();
- // add any ctest specific commands, probably should have common superclass
- // for ctest commands to clean this up. If a couple more commands are
- // created with the same format lets do that - ken
- this->AddCTestCommand(new cmCTestBuildCommand);
- this->AddCTestCommand(new cmCTestConfigureCommand);
- this->AddCTestCommand(new cmCTestCoverageCommand);
- this->AddCTestCommand(new cmCTestEmptyBinaryDirectoryCommand);
- this->AddCTestCommand(new cmCTestMemCheckCommand);
- this->AddCTestCommand(new cmCTestReadCustomFilesCommand);
- this->AddCTestCommand(new cmCTestRunScriptCommand);
- this->AddCTestCommand(new cmCTestSleepCommand);
- this->AddCTestCommand(new cmCTestStartCommand);
- this->AddCTestCommand(new cmCTestSubmitCommand);
- this->AddCTestCommand(new cmCTestTestCommand);
- this->AddCTestCommand(new cmCTestUpdateCommand);
-
// add the script arg if defined
if (script_arg.size())
{
diff --git a/Source/CTest/cmCTestScriptHandler.h b/Source/CTest/cmCTestScriptHandler.h
index f82f3ea..d410c4e 100644
--- a/Source/CTest/cmCTestScriptHandler.h
+++ b/Source/CTest/cmCTestScriptHandler.h
@@ -108,6 +108,9 @@ public:
void Initialize();
+ void CreateCMake();
+ void GetCommandDocumentation(std::vector<cmDocumentationEntry>& v) const;
+
private:
// reads in a script
int ReadInScript(const std::string& total_script_arg);