1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License for more information.
11 ============================================================================*/
12 #ifndef cmEnableTestingCommand_h
13 #define cmEnableTestingCommand_h
15 #include "cmCommand.h"
17 /** \class cmEnableTestingCommand
18 * \brief Enable testing for this directory and below.
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 CTest expects to find this file in the build directory root;
28 * therefore, this command should be in the source directory root too.
30 class cmEnableTestingCommand : public cmCommand
34 * This is a virtual constructor for the command.
36 virtual cmCommand* Clone()
38 return new cmEnableTestingCommand;
42 * This is called when the command is first encountered in
43 * the CMakeLists.txt file.
45 virtual bool InitialPass(std::vector<std::string> const&,
49 * The name of the command as specified in CMakeList.txt.
51 virtual const char* GetName() const { return "enable_testing";}
54 * Succinct documentation.
56 virtual const char* GetTerseDocumentation() const
58 return "Enable testing for current directory and below.";
64 virtual const char* GetFullDocumentation() const
68 "Enables testing for this directory and below. "
69 "See also the add_test command. Note that ctest expects to find "
70 "a test file in the build directory root. Therefore, this command "
71 "should be in the source directory root.";
74 cmTypeMacro(cmEnableTestingCommand, cmCommand);