cmCTestVC.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmCTestVC_h
  14. #define cmCTestVC_h
  15. #include "cmProcessTools.h"
  16. class cmCTest;
  17. /** \class cmCTestVC
  18. * \brief Base class for version control system handlers
  19. *
  20. */
  21. class cmCTestVC: public cmProcessTools
  22. {
  23. public:
  24. /** Construct with a CTest instance and update log stream. */
  25. cmCTestVC(cmCTest* ctest, std::ostream& log);
  26. virtual ~cmCTestVC();
  27. /** Command line tool to invoke. */
  28. void SetCommandLineTool(std::string const& tool);
  29. /** Top-level source directory. */
  30. void SetSourceDirectory(std::string const& dir);
  31. /** Get the date/time specification for the current nightly start time. */
  32. std::string GetNightlyTime();
  33. /** Perform cleanup operations on the work tree. */
  34. void Cleanup();
  35. void MarkOldRevision() { this->NoteOldRevision(); }
  36. void MarkNewRevision() { this->NoteNewRevision(); }
  37. protected:
  38. // Internal API to be implemented by subclasses.
  39. virtual void CleanupImpl();
  40. virtual void NoteOldRevision();
  41. virtual void NoteNewRevision();
  42. /** Convert a list of arguments to a human-readable command line. */
  43. static std::string ComputeCommandLine(char const* const* cmd);
  44. /** Run a command line and send output to given parsers. */
  45. bool RunChild(char const* const* cmd, OutputParser* out,
  46. OutputParser* err, const char* workDir = 0);
  47. // Instance of cmCTest running the script.
  48. cmCTest* CTest;
  49. // A stream to which we write log information.
  50. std::ostream& Log;
  51. // Basic information about the working tree.
  52. std::string CommandLineTool;
  53. std::string SourceDirectory;
  54. };
  55. #endif