cmCTestGIT.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 cmCTestGIT_h
  4. #define cmCTestGIT_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include "cmCTestGlobalVC.h"
  7. #include <iosfwd>
  8. #include <string>
  9. class cmCTest;
  10. /** \class cmCTestGIT
  11. * \brief Interaction with git command-line tool
  12. *
  13. */
  14. class cmCTestGIT : public cmCTestGlobalVC
  15. {
  16. public:
  17. /** Construct with a CTest instance and update log stream. */
  18. cmCTestGIT(cmCTest* ctest, std::ostream& log);
  19. ~cmCTestGIT() override;
  20. private:
  21. unsigned int CurrentGitVersion;
  22. unsigned int GetGitVersion();
  23. std::string GetWorkingRevision();
  24. bool NoteOldRevision() override;
  25. bool NoteNewRevision() override;
  26. bool UpdateImpl() override;
  27. std::string FindGitDir();
  28. std::string FindTopDir();
  29. bool UpdateByFetchAndReset();
  30. bool UpdateByCustom(std::string const& custom);
  31. bool UpdateInternal();
  32. bool LoadRevisions() override;
  33. bool LoadModifications() override;
  34. // "public" needed by older Sun compilers
  35. public:
  36. // Parsing helper classes.
  37. class CommitParser;
  38. class DiffParser;
  39. class OneLineParser;
  40. friend class CommitParser;
  41. friend class DiffParser;
  42. friend class OneLineParser;
  43. };
  44. #endif