cmCTestStartCommand.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 cmCTestStartCommand_h
  4. #define cmCTestStartCommand_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include "cmCTestCommand.h"
  7. #include "cmCommand.h"
  8. #include <iosfwd>
  9. #include <string>
  10. #include <utility>
  11. #include <vector>
  12. #include "cm_memory.hxx"
  13. class cmExecutionStatus;
  14. /** \class cmCTestStart
  15. * \brief Run a ctest script
  16. *
  17. * cmCTestStartCommand defineds the command to start the nightly testing.
  18. */
  19. class cmCTestStartCommand : public cmCTestCommand
  20. {
  21. public:
  22. cmCTestStartCommand();
  23. /**
  24. * This is a virtual constructor for the command.
  25. */
  26. std::unique_ptr<cmCommand> Clone() override
  27. {
  28. auto ni = cm::make_unique<cmCTestStartCommand>();
  29. ni->CTest = this->CTest;
  30. ni->CTestScriptHandler = this->CTestScriptHandler;
  31. ni->CreateNewTag = this->CreateNewTag;
  32. ni->Quiet = this->Quiet;
  33. return std::unique_ptr<cmCommand>(std::move(ni));
  34. }
  35. /**
  36. * This is called when the command is first encountered in
  37. * the CMakeLists.txt file.
  38. */
  39. bool InitialPass(std::vector<std::string> const& args,
  40. cmExecutionStatus& status) override;
  41. /**
  42. * Will this invocation of ctest_start create a new TAG file?
  43. */
  44. bool ShouldCreateNewTag() { return this->CreateNewTag; }
  45. /**
  46. * Should this invocation of ctest_start output non-error messages?
  47. */
  48. bool ShouldBeQuiet() { return this->Quiet; }
  49. private:
  50. bool InitialCheckout(std::ostream& ofs, std::string const& sourceDir);
  51. bool CreateNewTag;
  52. bool Quiet;
  53. };
  54. #endif