ENH: add submit via cp mode
[cmake.git] / Source / cmAddTestCommand.h
blob604c612eb4ddad424d31cb4b730a11573b93e950
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmAddTestCommand.h,v $
5 Language: C++
6 Date: $Date: 2009-03-16 14:51:13 $
7 Version: $Revision: 1.17 $
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 cmAddTestCommand_h
18 #define cmAddTestCommand_h
20 #include "cmCommand.h"
22 /** \class cmAddTestCommand
23 * \brief Add a test to the lists of tests to run.
25 * cmAddTestCommand adds a test to the list of tests to run .
27 class cmAddTestCommand : public cmCommand
29 public:
30 /**
31 * This is a virtual constructor for the command.
33 virtual cmCommand* Clone()
35 return new cmAddTestCommand;
38 /**
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,
43 cmExecutionStatus &status);
45 /**
46 * The name of the command as specified in CMakeList.txt.
48 virtual const char* GetName() { return "add_test";}
50 /**
51 * Succinct documentation.
53 virtual const char* GetTerseDocumentation()
55 return "Add a test to the project with the specified arguments.";
58 /**
59 * More documentation.
61 virtual const char* GetFullDocumentation()
63 return
64 " add_test(testname Exename arg1 arg2 ...)\n"
65 "If the ENABLE_TESTING command has been run, this command adds a "
66 "test target to the current directory. If ENABLE_TESTING has not "
67 "been run, this command does nothing. "
68 "The tests are run by the testing subsystem by executing Exename "
69 "with the specified arguments. Exename can be either an executable "
70 "built by this project or an arbitrary executable on the "
71 "system (like tclsh). The test will be run with the current working "
72 "directory set to the CMakeList.txt files corresponding directory "
73 "in the binary tree."
74 "\n"
75 " add_test(NAME <name> [CONFIGURATIONS [Debug|Release|...]]\n"
76 " COMMAND <command> [arg1 [arg2 ...]])\n"
77 "If COMMAND specifies an executable target (created by "
78 "add_executable) it will automatically be replaced by the location "
79 "of the executable created at build time. "
80 "If a CONFIGURATIONS option is given then the test will be executed "
81 "only when testing under one of the named configurations."
85 cmTypeMacro(cmAddTestCommand, cmCommand);
86 private:
87 bool HandleNameMode(std::vector<std::string> const& args);
91 #endif