1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmAddTestCommand.h,v $
6 <<<<<<< cmAddTestCommand.h
7 Date: $Date: 2008/01/23 15:27:59 $
8 Version: $Revision: 1.16 $
10 Date: $Date: 2009-03-16 14:51:13 $
11 Version: $Revision: 1.17 $
14 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
15 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
17 This software is distributed WITHOUT ANY WARRANTY; without even
18 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
19 PURPOSE. See the above copyright notices for more information.
21 =========================================================================*/
22 #ifndef cmAddTestCommand_h
23 #define cmAddTestCommand_h
25 #include "cmCommand.h"
27 /** \class cmAddTestCommand
28 * \brief Add a test to the lists of tests to run.
30 * cmAddTestCommand adds a test to the list of tests to run .
32 class cmAddTestCommand
: public cmCommand
36 * This is a virtual constructor for the command.
38 virtual cmCommand
* Clone()
40 return new cmAddTestCommand
;
44 * This is called when the command is first encountered in
45 * the CMakeLists.txt file.
47 virtual bool InitialPass(std::vector
<std::string
> const& args
,
48 cmExecutionStatus
&status
);
51 * The name of the command as specified in CMakeList.txt.
53 virtual const char* GetName() { return "add_test";}
56 * Succinct documentation.
58 virtual const char* GetTerseDocumentation()
60 return "Add a test to the project with the specified arguments.";
66 virtual const char* GetFullDocumentation()
69 " add_test(testname Exename arg1 arg2 ...)\n"
70 "If the ENABLE_TESTING command has been run, this command adds a "
71 "test target to the current directory. If ENABLE_TESTING has not "
72 "been run, this command does nothing. "
73 "The tests are run by the testing subsystem by executing Exename "
74 "with the specified arguments. Exename can be either an executable "
75 "built by this project or an arbitrary executable on the "
76 "system (like tclsh). The test will be run with the current working "
77 "directory set to the CMakeList.txt files corresponding directory "
80 " add_test(NAME <name> [CONFIGURATIONS [Debug|Release|...]]\n"
81 " COMMAND <command> [arg1 [arg2 ...]])\n"
82 "If COMMAND specifies an executable target (created by "
83 "add_executable) it will automatically be replaced by the location "
84 "of the executable created at build time. "
85 "If a CONFIGURATIONS option is given then the test will be executed "
86 "only when testing under one of the named configurations."
90 cmTypeMacro(cmAddTestCommand
, cmCommand
);
92 bool HandleNameMode(std::vector
<std::string
> const& args
);