cmCTestUpdateHandler.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. e_UNKNOWN = 0,
  29. e_CVS,
  30. e_SVN,
  31. e_BZR,
  32. e_GIT,
  33. e_HG,
  34. e_P4,
  35. e_LAST
  36. };
  37. /**
  38. * Initialize handler
  39. */
  40. virtual void Initialize();
  41. private:
  42. // Some structures needed for update
  43. struct StringPair :
  44. public std::pair<std::string, std::string>{};
  45. struct UpdateFiles : public std::vector<StringPair>{};
  46. // Determine the type of version control
  47. int DetermineType(const char* cmd, const char* type);
  48. // The VCS command to update the working tree.
  49. std::string UpdateCommand;
  50. int UpdateType;
  51. int DetectVCS(const char* dir);
  52. bool SelectVCS();
  53. };
  54. #endif