cmEnableTestingCommand.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Insight Consortium. All rights reserved.
  8. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmEnableTestingCommand_h
  14. #define cmEnableTestingCommand_h
  15. #include "cmStandardIncludes.h"
  16. #include "cmCommand.h"
  17. /** \class cmEnableTestingCommand
  18. * \brief Enable testing for this directory and below.
  19. *
  20. * Produce the output testfile. This produces a file in the build directory
  21. * called CMakeTestfile with a syntax similar to CMakeLists.txt. It contains
  22. * the SUBDIRS() and ADD_TEST() commands from the source CMakeLists.txt
  23. * file with CMake variables expanded. Only the subdirs and tests
  24. * within the valid control structures are replicated in Testfile
  25. * (i.e. SUBDIRS() and ADD_TEST() commands within IF() commands that are
  26. * not entered by CMake are not replicated in Testfile).
  27. * Note that Dart expects to find this file in the build directory root;
  28. * therefore, this command should be in the source directory root too.
  29. */
  30. class cmEnableTestingCommand : public cmCommand
  31. {
  32. public:
  33. /**
  34. * This is a virtual constructor for the command.
  35. */
  36. virtual cmCommand* Clone()
  37. {
  38. return new cmEnableTestingCommand;
  39. }
  40. /**
  41. * This determines if the command gets propagated down
  42. * to makefiles located in subdirectories.
  43. */
  44. virtual bool IsInherited() {return true;}
  45. /**
  46. * This is called when the command is first encountered in
  47. * the CMakeLists.txt file.
  48. */
  49. virtual bool InitialPass(std::vector<std::string> const& args) {
  50. return true;};
  51. /**
  52. * This is called at the end after all the information
  53. * specified by the command is accumulated. Most commands do
  54. * not implement this method. At this point, reading and
  55. * writing to the cache can be done.
  56. */
  57. virtual void FinalPass();
  58. /**
  59. * The name of the command as specified in CMakeList.txt.
  60. */
  61. virtual const char* GetName() { return "ENABLE_TESTING";}
  62. /**
  63. * Succinct documentation.
  64. */
  65. virtual const char* GetTerseDocumentation()
  66. {
  67. return "Enable testing for this directory and below.";
  68. }
  69. /**
  70. * More documentation.
  71. */
  72. virtual const char* GetFullDocumentation()
  73. {
  74. return
  75. "ENABLE_TESTING()\n"
  76. "Enables testing for this directory and below. See also the ADD_TEST command. Note that Dart expects to find this file in the build directory root; therefore, this command should be in the source directory root too.";
  77. }
  78. cmTypeMacro(cmEnableTestingCommand, cmCommand);
  79. };
  80. #endif