1
/*=========================================================================
3
Program: CMake - Cross-Platform Makefile Generator
4
Module: $RCSfile: cmCreateTestSourceList.h,v $
6
Date: $Date: 2004/04/28 16:31:18 $
7
Version: $Revision: 1.8 $
9
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12
This software is distributed WITHOUT ANY WARRANTY; without even
13
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14
PURPOSE. See the above copyright notices for more information.
16
=========================================================================*/
17
#ifndef cmCreateTestSourceList_h
18
#define cmCreateTestSourceList_h
20
#include "cmCommand.h"
22
/** \class cmCreateTestSourceList
27
class cmCreateTestSourceList : public cmCommand
31
* This is a virtual constructor for the command.
33
virtual cmCommand* Clone()
35
return new cmCreateTestSourceList;
39
* This is called when the command is first encountered in
40
* the CMakeLists.txt file.
42
virtual bool InitialPass(std::vector<std::string> const& args);
45
* This determines if the command gets propagated down
46
* to makefiles located in subdirectories.
48
virtual bool IsInherited() {return true;}
51
* The name of the command as specified in CMakeList.txt.
53
virtual const char* GetName() {return "CREATE_TEST_SOURCELIST";}
56
* Succinct documentation.
58
virtual const char* GetTerseDocumentation()
60
return "Create a test driver and source list for building test programs.";
66
virtual const char* GetFullDocumentation()
69
" CREATE_TEST_SOURCELIST(SourceListName DriverName\n"
70
" test1 test2 test3\n"
71
" EXTRA_INCLUDE include.h\n"
72
" FUNCTION function)\n"
73
"A test driver is a program that links together many small tests into "
74
"a single executable. This is useful when building static executables "
75
"with large libraries to shrink the total required size. "
76
"The list of source files "
77
"needed to build the testdriver will be in SourceListName. "
78
"DriverName is the name of the test driver program. The rest of "
79
"the arguments consist of a list of test source files, can be "
80
"; separated. Each test source file should have a function in it that "
81
"is the same name as the file with no extension (foo.cxx should have "
82
"int foo();) DriverName will be able to call each of the tests by "
83
"name on the command line. If EXTRA_INCLUDE is specified, then the "
84
"next argument is included into the generated file. If FUNCTION is "
85
"specified, then the next argument is taken as a function name that "
86
"is passed a pointer to ac and av. This can be used to add extra "
87
"command line processing to each test. The cmake variable "
88
"CMAKE_TESTDRIVER_BEFORE_TESTMAIN can be set to have code that will be "
89
"placed directly before calling the test main function. "
90
"CMAKE_TESTDRIVER_AFTER_TESTMAIN can be set to have code that will be "
91
"placed directly after the call to the test main function.";
94
cmTypeMacro(cmCreateTestSourceList, cmCommand);