cmCTestHandlerCommand.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 cmCTestHandlerCommand_h
  4. #define cmCTestHandlerCommand_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <string>
  7. #include <vector>
  8. #include "cmArgumentParser.h"
  9. #include "cmCTestCommand.h"
  10. class cmCTestGenericHandler;
  11. class cmExecutionStatus;
  12. /** \class cmCTestHandler
  13. * \brief Run a ctest script
  14. *
  15. * cmCTestHandlerCommand defineds the command to test the project.
  16. */
  17. class cmCTestHandlerCommand
  18. : public cmCTestCommand
  19. , public cmArgumentParser<void>
  20. {
  21. public:
  22. /**
  23. * The name of the command as specified in CMakeList.txt.
  24. */
  25. virtual std::string GetName() const = 0;
  26. /**
  27. * This is called when the command is first encountered in
  28. * the CMakeLists.txt file.
  29. */
  30. bool InitialPass(std::vector<std::string> const& args,
  31. cmExecutionStatus& status) override;
  32. protected:
  33. virtual cmCTestGenericHandler* InitializeHandler() = 0;
  34. virtual void ProcessAdditionalValues(cmCTestGenericHandler* handler);
  35. // Command argument handling.
  36. virtual void BindArguments();
  37. virtual void CheckArguments(std::vector<std::string> const& keywords);
  38. bool Append = false;
  39. bool Quiet = false;
  40. std::string CaptureCMakeError;
  41. std::string ReturnValue;
  42. std::string Build;
  43. std::string Source;
  44. std::string SubmitIndex;
  45. };
  46. #define CTEST_COMMAND_APPEND_OPTION_DOCS \
  47. "The APPEND option marks results for append to those previously " \
  48. "submitted to a dashboard server since the last ctest_start. " \
  49. "Append semantics are defined by the dashboard server in use."
  50. #endif