cmAddTestCommand.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Insight Consortium. All rights reserved.
  8. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm 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 "cmStandardIncludes.h"
  16. #include "cmCommand.h"
  17. /** \class cmAddTestCommand
  18. * \brief Add a test to the lists of tests to run.
  19. *
  20. * cmAddTestCommand adds a test to the list of tests to run .
  21. */
  22. class cmAddTestCommand : public cmCommand
  23. {
  24. public:
  25. /**
  26. * This is a virtual constructor for the command.
  27. */
  28. virtual cmCommand* Clone()
  29. {
  30. return new cmAddTestCommand;
  31. }
  32. /**
  33. * This is called when the command is first encountered in
  34. * the CMakeLists.txt file.
  35. */
  36. virtual bool InitialPass(std::vector<std::string> const& args);
  37. /**
  38. * This is called at the end after all the information
  39. * specified by the command is accumulated.
  40. */
  41. virtual void FinalPass();
  42. /**
  43. * The name of the command as specified in CMakeList.txt.
  44. */
  45. virtual const char* GetName() { return "ADD_TEST";}
  46. /**
  47. * Succinct documentation.
  48. */
  49. virtual const char* GetTerseDocumentation()
  50. {
  51. return "Add a test to the project with the specified arguments.";
  52. }
  53. /**
  54. * More documentation.
  55. */
  56. virtual const char* GetFullDocumentation()
  57. {
  58. return
  59. "ADD_TEST(testname exename arg1 arg2 arg3 ...)\n"
  60. "If the ENABLE_TESTING command has been run, this command adds a"
  61. "test target to the current directory. If ENABLE_TESTING has not"
  62. "been run, this command does nothing.\n"
  63. "The tests are run by the testing subsystem by executing exename "
  64. "with the specified arguments. exename can be either an executable "
  65. "built by built by this project or an arbitrary executable on the "
  66. "system (like tclsh).";
  67. }
  68. cmTypeMacro(cmAddTestCommand, cmCommand);
  69. private:
  70. std::vector<std::string> m_Args;
  71. };
  72. #endif