cmCTestHandlerCommand.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 "cmCTestCommand.h"
  7. #include <stddef.h>
  8. #include <string>
  9. #include <vector>
  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 : public cmCTestCommand
  18. {
  19. public:
  20. cmCTestHandlerCommand();
  21. /**
  22. * The name of the command as specified in CMakeList.txt.
  23. */
  24. virtual std::string GetName() const = 0;
  25. /**
  26. * This is called when the command is first encountered in
  27. * the CMakeLists.txt file.
  28. */
  29. bool InitialPass(std::vector<std::string> const& args,
  30. cmExecutionStatus& status) override;
  31. enum
  32. {
  33. ct_NONE,
  34. ct_RETURN_VALUE,
  35. ct_CAPTURE_CMAKE_ERROR,
  36. ct_BUILD,
  37. ct_SOURCE,
  38. ct_SUBMIT_INDEX,
  39. ct_LAST
  40. };
  41. protected:
  42. virtual cmCTestGenericHandler* InitializeHandler() = 0;
  43. virtual void ProcessAdditionalValues(cmCTestGenericHandler* handler);
  44. // Command argument handling.
  45. virtual bool CheckArgumentKeyword(std::string const& arg);
  46. virtual bool CheckArgumentValue(std::string const& arg);
  47. enum
  48. {
  49. ArgumentDoingNone,
  50. ArgumentDoingError,
  51. ArgumentDoingKeyword,
  52. ArgumentDoingLast1
  53. };
  54. int ArgumentDoing;
  55. unsigned int ArgumentIndex;
  56. bool AppendXML;
  57. bool Quiet;
  58. std::string ReturnVariable;
  59. std::vector<const char*> Arguments;
  60. std::vector<const char*> Values;
  61. size_t Last;
  62. };
  63. #define CTEST_COMMAND_APPEND_OPTION_DOCS \
  64. "The APPEND option marks results for append to those previously " \
  65. "submitted to a dashboard server since the last ctest_start. " \
  66. "Append semantics are defined by the dashboard server in use."
  67. #endif