cmCTestUpdateHandler.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #pragma once
  4. #include "cmConfigure.h" // IWYU pragma: keep
  5. #include <string>
  6. #include <utility>
  7. #include <vector>
  8. #include "cmCTestGenericHandler.h"
  9. /** \class cmCTestUpdateHandler
  10. * \brief A class that handles ctest -S invocations
  11. *
  12. */
  13. class cmCTestUpdateHandler : public cmCTestGenericHandler
  14. {
  15. public:
  16. using Superclass = cmCTestGenericHandler;
  17. /*
  18. * The main entry point for this class
  19. */
  20. int ProcessHandler() override;
  21. cmCTestUpdateHandler();
  22. enum
  23. {
  24. e_UNKNOWN = 0,
  25. e_CVS,
  26. e_SVN,
  27. e_BZR,
  28. e_GIT,
  29. e_HG,
  30. e_P4,
  31. e_LAST
  32. };
  33. /**
  34. * Initialize handler
  35. */
  36. void Initialize() override;
  37. private:
  38. // Some structures needed for update
  39. struct StringPair : public std::pair<std::string, std::string>
  40. {
  41. };
  42. struct UpdateFiles : public std::vector<StringPair>
  43. {
  44. };
  45. // Determine the type of version control
  46. int DetermineType(const char* cmd, const char* type);
  47. // The VCS command to update the working tree.
  48. std::string UpdateCommand;
  49. int UpdateType;
  50. int DetectVCS(const char* dir);
  51. bool SelectVCS();
  52. };