summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2017-05-10 19:06:48 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2017-05-11 17:49:06 (GMT)
commitc734c8501b5e8865b8a2e92a8834644becb181e4 (patch)
tree415841b22ec54c9f9e9389a1cffe412f837a2151 /Source/CTest
parentbd14e46400aaeb3afc826c6316b376eba6f082b2 (diff)
downloadCMake-c734c8501b5e8865b8a2e92a8834644becb181e4.zip
CMake-c734c8501b5e8865b8a2e92a8834644becb181e4.tar.gz
CMake-c734c8501b5e8865b8a2e92a8834644becb181e4.tar.bz2
CTest: use new methods for builtin commands
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx41
-rw-r--r--Source/CTest/cmCTestScriptHandler.h2
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx10
3 files changed, 26 insertions, 27 deletions
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/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 349e91a..e1b0967 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -1662,23 +1662,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")) {