cmAddTestCommand.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmAddTestCommand_h
  14. #define cmAddTestCommand_h
  15. #include "cmCommand.h"
  16. /** \class cmAddTestCommand
  17. * \brief Add a test to the lists of tests to run.
  18. *
  19. * cmAddTestCommand adds a test to the list of tests to run .
  20. */
  21. class cmAddTestCommand : public cmCommand
  22. {
  23. public:
  24. /**
  25. * This is a virtual constructor for the command.
  26. */
  27. virtual cmCommand* Clone()
  28. {
  29. return new cmAddTestCommand;
  30. }
  31. /**
  32. * This is called when the command is first encountered in
  33. * the CMakeLists.txt file.
  34. */
  35. virtual bool InitialPass(std::vector<std::string> const& args);
  36. /**
  37. * This is called at the end after all the information
  38. * specified by the command is accumulated.
  39. */
  40. virtual void FinalPass();
  41. /**
  42. * The name of the command as specified in CMakeList.txt.
  43. */
  44. virtual const char* GetName() { return "ADD_TEST";}
  45. /**
  46. * Succinct documentation.
  47. */
  48. virtual const char* GetTerseDocumentation()
  49. {
  50. return "Add a test to the project with the specified arguments.";
  51. }
  52. /**
  53. * More documentation.
  54. */
  55. virtual const char* GetFullDocumentation()
  56. {
  57. return
  58. " ADD_TEST(testname Exename arg1 arg2 ...)\n"
  59. "If the ENABLE_TESTING command has been run, this command adds a "
  60. "test target to the current directory. If ENABLE_TESTING has not "
  61. "been run, this command does nothing. "
  62. "The tests are run by the testing subsystem by executing Exename "
  63. "with the specified arguments. Exename can be either an executable "
  64. "built by built by this project or an arbitrary executable on the "
  65. "system (like tclsh).";
  66. }
  67. cmTypeMacro(cmAddTestCommand, cmCommand);
  68. private:
  69. std::vector<std::string> m_Args;
  70. };
  71. #endif