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 cmCTest;
  10. /** \class cmCTestUpdateHandler
  11. * \brief A class that handles ctest -S invocations
  12. *
  13. */
  14. class cmCTestUpdateHandler : public cmCTestGenericHandler
  15. {
  16. public:
  17. using Superclass = cmCTestGenericHandler;
  18. /*
  19. * The main entry point for this class
  20. */
  21. int ProcessHandler() override;
  22. cmCTestUpdateHandler(cmCTest* ctest);
  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. private:
  35. // Some structures needed for update
  36. struct StringPair : public std::pair<std::string, std::string>
  37. {
  38. };
  39. struct UpdateFiles : public std::vector<StringPair>
  40. {
  41. };
  42. // Determine the type of version control
  43. int DetermineType(const char* cmd, const char* type);
  44. // The VCS command to update the working tree.
  45. std::string UpdateCommand;
  46. std::string SourceDirectory;
  47. int UpdateType;
  48. int DetectVCS(const std::string& dir);
  49. bool SelectVCS();
  50. friend class cmCTestUpdateCommand;
  51. };