cmEnableTestingCommand.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmEnableTestingCommand_h
  4. #define cmEnableTestingCommand_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <string>
  7. #include <vector>
  8. #include "cmCommand.h"
  9. class cmExecutionStatus;
  10. /** \class cmEnableTestingCommand
  11. * \brief Enable testing for this directory and below.
  12. *
  13. * Produce the output testfile. This produces a file in the build directory
  14. * called CMakeTestfile with a syntax similar to CMakeLists.txt. It contains
  15. * the SUBDIRS() and ADD_TEST() commands from the source CMakeLists.txt
  16. * file with CMake variables expanded. Only the subdirs and tests
  17. * within the valid control structures are replicated in Testfile
  18. * (i.e. SUBDIRS() and ADD_TEST() commands within IF() commands that are
  19. * not entered by CMake are not replicated in Testfile).
  20. * Note that CTest expects to find this file in the build directory root;
  21. * therefore, this command should be in the source directory root too.
  22. */
  23. class cmEnableTestingCommand : public cmCommand
  24. {
  25. public:
  26. /**
  27. * This is a virtual constructor for the command.
  28. */
  29. cmCommand* Clone() override { return new cmEnableTestingCommand; }
  30. /**
  31. * This is called when the command is first encountered in
  32. * the CMakeLists.txt file.
  33. */
  34. bool InitialPass(std::vector<std::string> const&,
  35. cmExecutionStatus&) override;
  36. };
  37. #endif