[cmake-commits] alex committed cmCTestScriptHandler.cxx 1.37 1.38 cmCTestScriptHandler.h 1.18 1.19

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Jun 8 16:06:35 EDT 2007


Update of /cvsroot/CMake/CMake/Source/CTest
In directory public:/mounts/ram/cvs-serv5859/CTest

Modified Files:
	cmCTestScriptHandler.cxx cmCTestScriptHandler.h 
Log Message:

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


Index: cmCTestScriptHandler.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestScriptHandler.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- cmCTestScriptHandler.h	19 Oct 2006 14:45:19 -0000	1.18
+++ cmCTestScriptHandler.h	8 Jun 2007 20:06:33 -0000	1.19
@@ -108,6 +108,9 @@
 
   void Initialize();
 
+  void CreateCMake();
+  void GetCommandDocumentation(std::vector<cmDocumentationEntry>& v) const;
+
 private:
   // reads in a script
   int ReadInScript(const std::string& total_script_arg);

Index: cmCTestScriptHandler.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestScriptHandler.cxx,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- cmCTestScriptHandler.cxx	19 Oct 2006 14:45:19 -0000	1.37
+++ cmCTestScriptHandler.cxx	8 Jun 2007 20:06:33 -0000	1.38
@@ -283,6 +283,46 @@
   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 @@
     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 @@
   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())
     {



More information about the Cmake-commits mailing list