cmCTestHandlerCommand.h 1.8 KB

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