cmCTestTestCommand.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 cmCTestTestCommand_h
  11. #define cmCTestTestCommand_h
  12. #include "cmCTestHandlerCommand.h"
  13. /** \class cmCTestTest
  14. * \brief Run a ctest script
  15. *
  16. * cmCTestTestCommand defineds the command to test the project.
  17. */
  18. class cmCTestTestCommand : public cmCTestHandlerCommand
  19. {
  20. public:
  21. cmCTestTestCommand();
  22. /**
  23. * This is a virtual constructor for the command.
  24. */
  25. virtual cmCommand* Clone()
  26. {
  27. cmCTestTestCommand* ni = new cmCTestTestCommand;
  28. ni->CTest = this->CTest;
  29. ni->CTestScriptHandler = this->CTestScriptHandler;
  30. return ni;
  31. }
  32. /**
  33. * The name of the command as specified in CMakeList.txt.
  34. */
  35. virtual const char* GetName() { return "ctest_test";}
  36. /**
  37. * Succinct documentation.
  38. */
  39. virtual const char* GetTerseDocumentation()
  40. {
  41. return "Run tests in the project build tree.";
  42. }
  43. /**
  44. * More documentation.
  45. */
  46. virtual const char* GetFullDocumentation()
  47. {
  48. return
  49. " ctest_test([BUILD build_dir] [APPEND]\n"
  50. " [START start number] [END end number]\n"
  51. " [STRIDE stride number] [EXCLUDE exclude regex ]\n"
  52. " [INCLUDE include regex] [RETURN_VALUE res] \n"
  53. " [EXCLUDE_LABEL exclude regex] \n"
  54. " [INCLUDE_LABEL label regex] \n"
  55. " [PARALLEL_LEVEL level]) \n"
  56. "Tests the given build directory and stores results in Test.xml. The "
  57. "second argument is a variable that will hold value. Optionally, "
  58. "you can specify the starting test number START, the ending test number "
  59. "END, the number of tests to skip between each test STRIDE, a regular "
  60. "expression for tests to run INCLUDE, or a regular expression for tests "
  61. "to not run EXCLUDE. EXCLUDE_LABEL and INCLUDE_LABEL are regular "
  62. "expression for test to be included or excluded by the test "
  63. "property LABEL. PARALLEL_LEVEL should be set to a positive number "
  64. "representing the number of tests to be run in parallel."
  65. "\n"
  66. CTEST_COMMAND_APPEND_OPTION_DOCS;
  67. }
  68. cmTypeMacro(cmCTestTestCommand, cmCTestHandlerCommand);
  69. protected:
  70. virtual cmCTestGenericHandler* InitializeActualHandler();
  71. cmCTestGenericHandler* InitializeHandler();
  72. enum {
  73. ctt_BUILD = ct_LAST,
  74. ctt_RETURN_VALUE,
  75. ctt_START,
  76. ctt_END,
  77. ctt_STRIDE,
  78. ctt_EXCLUDE,
  79. ctt_INCLUDE,
  80. ctt_EXCLUDE_LABEL,
  81. ctt_INCLUDE_LABEL,
  82. ctt_PARALLEL_LEVEL,
  83. ctt_LAST
  84. };
  85. };
  86. #endif