packaging: Initial packaging
[platform/upstream/cmake.git] / Source / cmCreateTestSourceList.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 cmCreateTestSourceList_h
13 #define cmCreateTestSourceList_h
14
15 #include "cmCommand.h"
16
17 /** \class cmCreateTestSourceList
18  * \brief
19  *
20  */
21
22 class cmCreateTestSourceList : public cmCommand
23 {
24 public:
25   /**
26    * This is a virtual constructor for the command.
27    */
28   virtual cmCommand* Clone()
29     {
30     return new cmCreateTestSourceList;
31     }
32
33   /**
34    * This is called when the command is first encountered in
35    * the CMakeLists.txt file.
36    */
37   virtual bool InitialPass(std::vector<std::string> const& args,
38                            cmExecutionStatus &status);
39
40   /**
41    * The name of the command as specified in CMakeList.txt.
42    */
43   virtual const char* GetName() const {return "create_test_sourcelist";}
44
45   /**
46    * Succinct documentation.
47    */
48   virtual const char* GetTerseDocumentation() const
49     {
50     return "Create a test driver and source list for building test programs.";
51     }
52
53   /**
54    * More documentation.
55    */
56   virtual const char* GetFullDocumentation() const
57     {
58     return
59       "  create_test_sourcelist(sourceListName driverName\n"
60       "                         test1 test2 test3\n"
61       "                         EXTRA_INCLUDE include.h\n"
62       "                         FUNCTION function)\n"
63       "A test driver is a program that links together many small tests into "
64       "a single executable.  This is useful when building static executables "
65       "with large libraries to shrink the total required size.  "
66       "The list of source files "
67       "needed to build the test driver will be in sourceListName.  "
68       "DriverName is the name of the test driver program.  The rest of "
69       "the arguments consist of a list of test source files, can be "
70       "semicolon separated.  Each test source file should have a function in "
71       "it that is the same name as the file with no extension (foo.cxx "
72       "should have int foo(int, char*[]);) DriverName will be able to "
73       "call each of the "
74       "tests by name on the command line. If EXTRA_INCLUDE is specified, "
75       "then the next argument is included into the generated file. If "
76       "FUNCTION is specified, then the next argument is taken as a function "
77       "name that is passed a pointer to ac and av.  This can be used to add "
78       "extra command line processing to each test. The cmake variable "
79       "CMAKE_TESTDRIVER_BEFORE_TESTMAIN can be set to have code that will be "
80       "placed directly before calling the test main function.   "
81       "CMAKE_TESTDRIVER_AFTER_TESTMAIN can be set to have code that will be "
82       "placed directly after the call to the test main function.";
83     }
84
85   cmTypeMacro(cmCreateTestSourceList, cmCommand);
86 };
87
88
89
90 #endif