cmCTestHandlerCommand.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 <string>
  6. #include <vector>
  7. #include "cmArgumentParser.h"
  8. #include "cmCTestCommand.h"
  9. class cmCTestGenericHandler;
  10. class cmExecutionStatus;
  11. /** \class cmCTestHandler
  12. * \brief Run a ctest script
  13. *
  14. * cmCTestHandlerCommand defineds the command to test the project.
  15. */
  16. class cmCTestHandlerCommand
  17. : public cmCTestCommand
  18. , public cmArgumentParser<void>
  19. {
  20. public:
  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. protected:
  32. virtual cmCTestGenericHandler* InitializeHandler() = 0;
  33. virtual void ProcessAdditionalValues(cmCTestGenericHandler* handler);
  34. // Command argument handling.
  35. virtual void BindArguments();
  36. virtual void CheckArguments();
  37. bool Append = false;
  38. bool Quiet = false;
  39. std::string CaptureCMakeError;
  40. std::string ReturnValue;
  41. std::string Build;
  42. std::string Source;
  43. std::string SubmitIndex;
  44. };
  45. #define CTEST_COMMAND_APPEND_OPTION_DOCS \
  46. "The APPEND option marks results for append to those previously " \
  47. "submitted to a dashboard server since the last ctest_start. " \
  48. "Append semantics are defined by the dashboard server in use."