cmCTestHandlerCommand.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmCTestHandlerCommand_h
  11. #define cmCTestHandlerCommand_h
  12. #include <cmConfigure.h>
  13. #include "cmCTestCommand.h"
  14. #include "cmTypeMacro.h"
  15. #include <stddef.h>
  16. #include <string>
  17. #include <vector>
  18. class cmCTestGenericHandler;
  19. class cmExecutionStatus;
  20. /** \class cmCTestHandler
  21. * \brief Run a ctest script
  22. *
  23. * cmCTestHandlerCommand defineds the command to test the project.
  24. */
  25. class cmCTestHandlerCommand : public cmCTestCommand
  26. {
  27. public:
  28. cmCTestHandlerCommand();
  29. /**
  30. * This is called when the command is first encountered in
  31. * the CMakeLists.txt file.
  32. */
  33. bool InitialPass(std::vector<std::string> const& args,
  34. cmExecutionStatus& status) CM_OVERRIDE;
  35. cmTypeMacro(cmCTestHandlerCommand, cmCTestCommand);
  36. enum
  37. {
  38. ct_NONE,
  39. ct_RETURN_VALUE,
  40. ct_BUILD,
  41. ct_SOURCE,
  42. ct_SUBMIT_INDEX,
  43. ct_LAST
  44. };
  45. protected:
  46. virtual cmCTestGenericHandler* InitializeHandler() = 0;
  47. // Command argument handling.
  48. virtual bool CheckArgumentKeyword(std::string const& arg);
  49. virtual bool CheckArgumentValue(std::string const& arg);
  50. enum
  51. {
  52. ArgumentDoingNone,
  53. ArgumentDoingError,
  54. ArgumentDoingKeyword,
  55. ArgumentDoingLast1
  56. };
  57. int ArgumentDoing;
  58. unsigned int ArgumentIndex;
  59. bool AppendXML;
  60. bool Quiet;
  61. std::string ReturnVariable;
  62. std::vector<const char*> Arguments;
  63. std::vector<const char*> Values;
  64. size_t Last;
  65. };
  66. #define CTEST_COMMAND_APPEND_OPTION_DOCS \
  67. "The APPEND option marks results for append to those previously " \
  68. "submitted to a dashboard server since the last ctest_start. " \
  69. "Append semantics are defined by the dashboard server in use."
  70. #endif