cmCTestStartCommand.h 1.6 KB

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