cmEnableTestingCommand.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 std::string GetName() const { return "enable_testing";}
  46. cmTypeMacro(cmEnableTestingCommand, cmCommand);
  47. };
  48. #endif