cmCTestUpdateHandler.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmCTestUpdateHandler_h
  4. #define cmCTestUpdateHandler_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include "cmCTestGenericHandler.h"
  7. #include <string>
  8. #include <utility>
  9. #include <vector>
  10. /** \class cmCTestUpdateHandler
  11. * \brief A class that handles ctest -S invocations
  12. *
  13. */
  14. class cmCTestUpdateHandler : public cmCTestGenericHandler
  15. {
  16. public:
  17. typedef cmCTestGenericHandler Superclass;
  18. /*
  19. * The main entry point for this class
  20. */
  21. int ProcessHandler() override;
  22. cmCTestUpdateHandler();
  23. enum
  24. {
  25. e_UNKNOWN = 0,
  26. e_CVS,
  27. e_SVN,
  28. e_BZR,
  29. e_GIT,
  30. e_HG,
  31. e_P4,
  32. e_LAST
  33. };
  34. /**
  35. * Initialize handler
  36. */
  37. void Initialize() override;
  38. private:
  39. // Some structures needed for update
  40. struct StringPair : public std::pair<std::string, std::string>
  41. {
  42. };
  43. struct UpdateFiles : public std::vector<StringPair>
  44. {
  45. };
  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