ENH: Add cmCTestCVS and cmCTestSVN

These cmCTestVC subclasses will implement interaction with CVS and SVN
tools.
This commit is contained in:
Brad King 2009-02-24 10:39:55 -05:00
parent 1b8ea27bd1
commit 6bdc2b5d99
6 changed files with 145 additions and 0 deletions

View File

@ -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

View File

@ -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()
{
}

35
Source/CTest/cmCTestCVS.h Normal file
View File

@ -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

View File

@ -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()
{
}

35
Source/CTest/cmCTestSVN.h Normal file
View File

@ -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

View File

@ -27,6 +27,12 @@
#include "cmXMLParser.h"
#include "cmXMLSafe.h"
#include "cmCTestVC.h"
#include "cmCTestCVS.h"
#include "cmCTestSVN.h"
#include <cmsys/auto_ptr.hxx>
//#include <cmsys/RegularExpression.hxx>
#include <cmsys/Process.h>
@ -323,6 +329,17 @@ int cmCTestUpdateHandler::ProcessHandler()
<< " repository type"
<< std::endl;);
// Create an object to interact with the VCS tool.
cmsys::auto_ptr<cmCTestVC> 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");