cmCTestUpdateHandler.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc.
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmCTestUpdateHandler_h
  11. #define cmCTestUpdateHandler_h
  12. #include "cmCTestGenericHandler.h"
  13. #include "cmListFileCache.h"
  14. /** \class cmCTestUpdateHandler
  15. * \brief A class that handles ctest -S invocations
  16. *
  17. */
  18. class cmCTestUpdateHandler : public cmCTestGenericHandler
  19. {
  20. public:
  21. cmTypeMacro(cmCTestUpdateHandler, cmCTestGenericHandler);
  22. /*
  23. * The main entry point for this class
  24. */
  25. int ProcessHandler();
  26. cmCTestUpdateHandler();
  27. enum
  28. {
  29. e_UNKNOWN = 0,
  30. e_CVS,
  31. e_SVN,
  32. e_BZR,
  33. e_GIT,
  34. e_HG,
  35. e_P4,
  36. e_LAST
  37. };
  38. /**
  39. * Initialize handler
  40. */
  41. virtual void Initialize();
  42. private:
  43. // Some structures needed for update
  44. struct StringPair : public std::pair<std::string, std::string>
  45. {
  46. };
  47. struct UpdateFiles : public std::vector<StringPair>
  48. {
  49. };
  50. // Determine the type of version control
  51. int DetermineType(const char* cmd, const char* type);
  52. // The VCS command to update the working tree.
  53. std::string UpdateCommand;
  54. int UpdateType;
  55. int DetectVCS(const char* dir);
  56. bool SelectVCS();
  57. };
  58. #endif