Imported Upstream version 2.8.9
[platform/upstream/cmake.git] / Source / cmEnableTestingCommand.h
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
4
5   Distributed under the OSI-approved BSD License (the "License");
6   see accompanying file Copyright.txt for details.
7
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
14
15 #include "cmCommand.h"
16
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 CTest 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   /**
42    * This is called when the command is first encountered in
43    * the CMakeLists.txt file.
44    */
45   virtual bool InitialPass(std::vector<std::string> const&,
46                            cmExecutionStatus &);
47
48   /**
49    * The name of the command as specified in CMakeList.txt.
50    */
51   virtual const char* GetName() const { return "enable_testing";}
52
53   /**
54    * Succinct documentation.
55    */
56   virtual const char* GetTerseDocumentation() const
57     {
58     return "Enable testing for current directory and below.";
59     }
60   
61   /**
62    * More documentation.
63    */
64   virtual const char* GetFullDocumentation() const
65     {
66     return
67       "  enable_testing()\n"
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.";
72     }
73   
74   cmTypeMacro(cmEnableTestingCommand, cmCommand);
75   
76 };
77
78
79 #endif