cmEnableTestingCommand.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 cmEnableTestingCommand_h
  11. #define cmEnableTestingCommand_h
  12. #include "cmCommand.h"
  13. /** \class cmEnableTestingCommand
  14. * \brief Enable testing for this directory and below.
  15. *
  16. * Produce the output testfile. This produces a file in the build directory
  17. * called CMakeTestfile with a syntax similar to CMakeLists.txt. It contains
  18. * the SUBDIRS() and ADD_TEST() commands from the source CMakeLists.txt
  19. * file with CMake variables expanded. Only the subdirs and tests
  20. * within the valid control structures are replicated in Testfile
  21. * (i.e. SUBDIRS() and ADD_TEST() commands within IF() commands that are
  22. * not entered by CMake are not replicated in Testfile).
  23. * Note that CTest expects to find this file in the build directory root;
  24. * therefore, this command should be in the source directory root too.
  25. */
  26. class cmEnableTestingCommand : public cmCommand
  27. {
  28. public:
  29. /**
  30. * This is a virtual constructor for the command.
  31. */
  32. virtual cmCommand* Clone()
  33. {
  34. return new cmEnableTestingCommand;
  35. }
  36. /**
  37. * This is called when the command is first encountered in
  38. * the CMakeLists.txt file.
  39. */
  40. virtual bool InitialPass(std::vector<std::string> const&,
  41. cmExecutionStatus &);
  42. /**
  43. * The name of the command as specified in CMakeList.txt.
  44. */
  45. virtual const char* GetName() const { return "enable_testing";}
  46. /**
  47. * Succinct documentation.
  48. */
  49. virtual const char* GetTerseDocumentation() const
  50. {
  51. return "Enable testing for current directory and below.";
  52. }
  53. /**
  54. * More documentation.
  55. */
  56. virtual const char* GetFullDocumentation() const
  57. {
  58. return
  59. " enable_testing()\n"
  60. "Enables testing for this directory and below. "
  61. "See also the add_test command. Note that ctest expects to find "
  62. "a test file in the build directory root. Therefore, this command "
  63. "should be in the source directory root.";
  64. }
  65. cmTypeMacro(cmEnableTestingCommand, cmCommand);
  66. };
  67. #endif