From 6bdc2b5d99313ab6418b07ff91320135907ac261 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 24 Feb 2009 10:39:55 -0500 Subject: [PATCH] ENH: Add cmCTestCVS and cmCTestSVN These cmCTestVC subclasses will implement interaction with CVS and SVN tools. --- Source/CMakeLists.txt | 4 +++ Source/CTest/cmCTestCVS.cxx | 27 +++++++++++++++++++++ Source/CTest/cmCTestCVS.h | 35 +++++++++++++++++++++++++++ Source/CTest/cmCTestSVN.cxx | 27 +++++++++++++++++++++ Source/CTest/cmCTestSVN.h | 35 +++++++++++++++++++++++++++ Source/CTest/cmCTestUpdateHandler.cxx | 17 +++++++++++++ 6 files changed, 145 insertions(+) create mode 100644 Source/CTest/cmCTestCVS.cxx create mode 100644 Source/CTest/cmCTestCVS.h create mode 100644 Source/CTest/cmCTestSVN.cxx create mode 100644 Source/CTest/cmCTestSVN.h diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 43731c215..318033941 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -345,6 +345,10 @@ SET(CTEST_SRCS cmCTest.cxx CTest/cmCTestVC.cxx CTest/cmCTestVC.h + CTest/cmCTestCVS.cxx + CTest/cmCTestCVS.h + CTest/cmCTestSVN.cxx + CTest/cmCTestSVN.h ) # Build CTestLib diff --git a/Source/CTest/cmCTestCVS.cxx b/Source/CTest/cmCTestCVS.cxx new file mode 100644 index 000000000..0f4477ed0 --- /dev/null +++ b/Source/CTest/cmCTestCVS.cxx @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile$ + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) 2002 Kitware, Inc. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "cmCTestCVS.h" + +//---------------------------------------------------------------------------- +cmCTestCVS::cmCTestCVS(cmCTest* ct, std::ostream& log): cmCTestVC(ct, log) +{ +} + +//---------------------------------------------------------------------------- +cmCTestCVS::~cmCTestCVS() +{ +} diff --git a/Source/CTest/cmCTestCVS.h b/Source/CTest/cmCTestCVS.h new file mode 100644 index 000000000..f5175c24e --- /dev/null +++ b/Source/CTest/cmCTestCVS.h @@ -0,0 +1,35 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile$ + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) 2002 Kitware, Inc. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmCTestCVS_h +#define cmCTestCVS_h + +#include "cmCTestVC.h" + +/** \class cmCTestCVS + * \brief Interaction with cvs command-line tool + * + */ +class cmCTestCVS: public cmCTestVC +{ +public: + /** Construct with a CTest instance and update log stream. */ + cmCTestCVS(cmCTest* ctest, std::ostream& log); + + virtual ~cmCTestCVS(); +}; + +#endif diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx new file mode 100644 index 000000000..f7111c961 --- /dev/null +++ b/Source/CTest/cmCTestSVN.cxx @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile$ + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) 2002 Kitware, Inc. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "cmCTestSVN.h" + +//---------------------------------------------------------------------------- +cmCTestSVN::cmCTestSVN(cmCTest* ct, std::ostream& log): cmCTestVC(ct, log) +{ +} + +//---------------------------------------------------------------------------- +cmCTestSVN::~cmCTestSVN() +{ +} diff --git a/Source/CTest/cmCTestSVN.h b/Source/CTest/cmCTestSVN.h new file mode 100644 index 000000000..b00309449 --- /dev/null +++ b/Source/CTest/cmCTestSVN.h @@ -0,0 +1,35 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile$ + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) 2002 Kitware, Inc. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmCTestSVN_h +#define cmCTestSVN_h + +#include "cmCTestVC.h" + +/** \class cmCTestSVN + * \brief Interaction with subversion command-line tool + * + */ +class cmCTestSVN: public cmCTestVC +{ +public: + /** Construct with a CTest instance and update log stream. */ + cmCTestSVN(cmCTest* ctest, std::ostream& log); + + virtual ~cmCTestSVN(); +}; + +#endif diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index 014e16d85..cce8f2f1e 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -27,6 +27,12 @@ #include "cmXMLParser.h" #include "cmXMLSafe.h" +#include "cmCTestVC.h" +#include "cmCTestCVS.h" +#include "cmCTestSVN.h" + +#include + //#include #include @@ -323,6 +329,17 @@ int cmCTestUpdateHandler::ProcessHandler() << " repository type" << std::endl;); + // Create an object to interact with the VCS tool. + cmsys::auto_ptr vc; + switch (this->UpdateType) + { + case e_CVS: vc.reset(new cmCTestCVS(this->CTest, ofs)); break; + case e_SVN: vc.reset(new cmCTestSVN(this->CTest, ofs)); break; + default: vc.reset(new cmCTestVC(this->CTest, ofs)); break; + } + vc->SetCommandLineTool(this->UpdateCommand); + vc->SetSourceDirectory(sourceDirectory); + // And update options std::string updateOptions = this->CTest->GetCTestConfiguration("UpdateOptions");