diff options
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h | 8 | ||||
-rw-r--r-- | Source/CTest/cmCTestHandlerCommand.h | 5 | ||||
-rw-r--r-- | Source/CTest/cmCTestMemCheckCommand.cxx | 1 | ||||
-rw-r--r-- | Source/CTest/cmCTestMemCheckCommand.h | 7 | ||||
-rw-r--r-- | Source/CTest/cmCTestReadCustomFilesCommand.h | 5 | ||||
-rw-r--r-- | Source/CTest/cmCTestRunScriptCommand.h | 5 | ||||
-rw-r--r-- | Source/CTest/cmCTestScriptHandler.cxx | 41 | ||||
-rw-r--r-- | Source/CTest/cmCTestScriptHandler.h | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestSleepCommand.h | 5 | ||||
-rw-r--r-- | Source/CTest/cmCTestStartCommand.h | 5 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 30 |
11 files changed, 32 insertions, 82 deletions
diff --git a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h index bfd4061..503ed23 100644 --- a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h +++ b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h @@ -42,14 +42,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE - { - return "ctest_empty_binary_directory"; - } }; #endif diff --git a/Source/CTest/cmCTestHandlerCommand.h b/Source/CTest/cmCTestHandlerCommand.h index adc1687..0ea0612 100644 --- a/Source/CTest/cmCTestHandlerCommand.h +++ b/Source/CTest/cmCTestHandlerCommand.h @@ -25,6 +25,11 @@ public: cmCTestHandlerCommand(); /** + * The name of the command as specified in CMakeList.txt. + */ + virtual std::string GetName() const = 0; + + /** * This is called when the command is first encountered in * the CMakeLists.txt file. */ diff --git a/Source/CTest/cmCTestMemCheckCommand.cxx b/Source/CTest/cmCTestMemCheckCommand.cxx index fd7c3a9..b9cae3b 100644 --- a/Source/CTest/cmCTestMemCheckCommand.cxx +++ b/Source/CTest/cmCTestMemCheckCommand.cxx @@ -3,6 +3,7 @@ #include "cmCTestMemCheckCommand.h" #include <sstream> +#include <string> #include <vector> #include "cmCTest.h" diff --git a/Source/CTest/cmCTestMemCheckCommand.h b/Source/CTest/cmCTestMemCheckCommand.h index fea65e8..fa59559 100644 --- a/Source/CTest/cmCTestMemCheckCommand.h +++ b/Source/CTest/cmCTestMemCheckCommand.h @@ -7,8 +7,6 @@ #include "cmCTestTestCommand.h" -#include <string> - class cmCTestGenericHandler; class cmCommand; @@ -33,11 +31,6 @@ public: return ni; } - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "ctest_memcheck"; } - protected: cmCTestGenericHandler* InitializeActualHandler() CM_OVERRIDE; diff --git a/Source/CTest/cmCTestReadCustomFilesCommand.h b/Source/CTest/cmCTestReadCustomFilesCommand.h index 04024ab..5989fa0 100644 --- a/Source/CTest/cmCTestReadCustomFilesCommand.h +++ b/Source/CTest/cmCTestReadCustomFilesCommand.h @@ -40,11 +40,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "ctest_read_custom_files"; } }; #endif diff --git a/Source/CTest/cmCTestRunScriptCommand.h b/Source/CTest/cmCTestRunScriptCommand.h index aac5114..9bd0965 100644 --- a/Source/CTest/cmCTestRunScriptCommand.h +++ b/Source/CTest/cmCTestRunScriptCommand.h @@ -41,11 +41,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "ctest_run_script"; } }; #endif diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 1fea8e5..1d29dfa 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -166,12 +166,12 @@ void cmCTestScriptHandler::UpdateElapsedTime() } } -void cmCTestScriptHandler::AddCTestCommand(cmCTestCommand* command) +void cmCTestScriptHandler::AddCTestCommand(std::string const& name, + cmCTestCommand* command) { - cmCTestCommand* newCom = command; - newCom->CTest = this->CTest; - newCom->CTestScriptHandler = this; - this->CMake->GetState()->AddCommand(newCom); + command->CTest = this->CTest; + command->CTestScriptHandler = this; + this->CMake->GetState()->AddBuiltinCommand(name, command); } int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) @@ -290,22 +290,21 @@ void cmCTestScriptHandler::CreateCMake() this->CMake->SetProgressCallback(ctestScriptProgressCallback, this->CTest); - // 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); - this->AddCTestCommand(new cmCTestUploadCommand); + this->AddCTestCommand("ctest_build", new cmCTestBuildCommand); + this->AddCTestCommand("ctest_configure", new cmCTestConfigureCommand); + this->AddCTestCommand("ctest_coverage", new cmCTestCoverageCommand); + this->AddCTestCommand("ctest_empty_binary_directory", + new cmCTestEmptyBinaryDirectoryCommand); + this->AddCTestCommand("ctest_memcheck", new cmCTestMemCheckCommand); + this->AddCTestCommand("ctest_read_custom_files", + new cmCTestReadCustomFilesCommand); + this->AddCTestCommand("ctest_run_script", new cmCTestRunScriptCommand); + this->AddCTestCommand("ctest_sleep", new cmCTestSleepCommand); + this->AddCTestCommand("ctest_start", new cmCTestStartCommand); + this->AddCTestCommand("ctest_submit", new cmCTestSubmitCommand); + this->AddCTestCommand("ctest_test", new cmCTestTestCommand); + this->AddCTestCommand("ctest_update", new cmCTestUpdateCommand); + this->AddCTestCommand("ctest_upload", new cmCTestUploadCommand); } // this sets up some variables for the script to use, creates the required diff --git a/Source/CTest/cmCTestScriptHandler.h b/Source/CTest/cmCTestScriptHandler.h index 3070796..6678702 100644 --- a/Source/CTest/cmCTestScriptHandler.h +++ b/Source/CTest/cmCTestScriptHandler.h @@ -126,7 +126,7 @@ private: int RunConfigurationDashboard(); // Add ctest command - void AddCTestCommand(cmCTestCommand* command); + void AddCTestCommand(std::string const& name, cmCTestCommand* command); // Try to remove the binary directory once static bool TryToRemoveBinaryDirectoryOnce(const std::string& directoryPath); diff --git a/Source/CTest/cmCTestSleepCommand.h b/Source/CTest/cmCTestSleepCommand.h index a55e9d9..f0b5f1e 100644 --- a/Source/CTest/cmCTestSleepCommand.h +++ b/Source/CTest/cmCTestSleepCommand.h @@ -41,11 +41,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "ctest_sleep"; } }; #endif diff --git a/Source/CTest/cmCTestStartCommand.h b/Source/CTest/cmCTestStartCommand.h index 26a63fb..b4943f9 100644 --- a/Source/CTest/cmCTestStartCommand.h +++ b/Source/CTest/cmCTestStartCommand.h @@ -54,11 +54,6 @@ public: */ bool ShouldBeQuiet() { return this->Quiet; } - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "ctest_start"; } - private: bool InitialCheckout(std::ostream& ofs, std::string const& sourceDir); bool CreateNewTag; diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 349e91a..da3ae2f 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -56,11 +56,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& /*unused*/) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "subdirs"; } - cmCTestTestHandler* TestHandler; }; @@ -136,11 +131,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& /*unused*/) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "add_subdirectory"; } - cmCTestTestHandler* TestHandler; }; @@ -206,11 +196,6 @@ public: bool InitialPass(std::vector<std::string> const& /*args*/, cmExecutionStatus& /*unused*/) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "add_test"; } - cmCTestTestHandler* TestHandler; }; @@ -244,11 +229,6 @@ public: bool InitialPass(std::vector<std::string> const& /*args*/, cmExecutionStatus& /*unused*/) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "set_tests_properties"; } - cmCTestTestHandler* TestHandler; }; @@ -1662,23 +1642,23 @@ void cmCTestTestHandler::GetListOfTests() // Add handler for ADD_TEST cmCTestAddTestCommand* newCom1 = new cmCTestAddTestCommand; newCom1->TestHandler = this; - cm.GetState()->AddCommand(newCom1); + cm.GetState()->AddBuiltinCommand("add_test", newCom1); // Add handler for SUBDIRS cmCTestSubdirCommand* newCom2 = new cmCTestSubdirCommand; newCom2->TestHandler = this; - cm.GetState()->AddCommand(newCom2); + cm.GetState()->AddBuiltinCommand("subdirs", newCom2); // Add handler for ADD_SUBDIRECTORY cmCTestAddSubdirectoryCommand* newCom3 = new cmCTestAddSubdirectoryCommand; newCom3->TestHandler = this; - cm.GetState()->AddCommand(newCom3); + cm.GetState()->AddBuiltinCommand("add_subdirectory", newCom3); - // Add handler for SET_SOURCE_FILES_PROPERTIES + // Add handler for SET_TESTS_PROPERTIES cmCTestSetTestsPropertiesCommand* newCom4 = new cmCTestSetTestsPropertiesCommand; newCom4->TestHandler = this; - cm.GetState()->AddCommand(newCom4); + cm.GetState()->AddBuiltinCommand("set_tests_properties", newCom4); const char* testFilename; if (cmSystemTools::FileExists("CTestTestfile.cmake")) { |