You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
3.2 KiB

20 years ago
20 years ago
  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 cmCreateTestSourceList_h
  14. #define cmCreateTestSourceList_h
  15. #include "cmCommand.h"
  16. /** \class cmCreateTestSourceList
  17. * \brief
  18. *
  19. */
  20. class cmCreateTestSourceList : public cmCommand
  21. {
  22. public:
  23. /**
  24. * This is a virtual constructor for the command.
  25. */
  26. virtual cmCommand* Clone()
  27. {
  28. return new cmCreateTestSourceList;
  29. }
  30. /**
  31. * This is called when the command is first encountered in
  32. * the CMakeLists.txt file.
  33. */
  34. virtual bool InitialPass(std::vector<std::string> const& args);
  35. /**
  36. * The name of the command as specified in CMakeList.txt.
  37. */
  38. virtual const char* GetName() {return "CREATE_TEST_SOURCELIST";}
  39. /**
  40. * Succinct documentation.
  41. */
  42. virtual const char* GetTerseDocumentation()
  43. {
  44. return "Create a test driver and source list for building test programs.";
  45. }
  46. /**
  47. * More documentation.
  48. */
  49. virtual const char* GetFullDocumentation()
  50. {
  51. return
  52. " CREATE_TEST_SOURCELIST(SourceListName DriverName\n"
  53. " test1 test2 test3\n"
  54. " EXTRA_INCLUDE include.h\n"
  55. " FUNCTION function)\n"
  56. "A test driver is a program that links together many small tests into "
  57. "a single executable. This is useful when building static executables "
  58. "with large libraries to shrink the total required size. "
  59. "The list of source files "
  60. "needed to build the test driver will be in SourceListName. "
  61. "DriverName is the name of the test driver program. The rest of "
  62. "the arguments consist of a list of test source files, can be "
  63. "semicolon separated. Each test source file should have a function in "
  64. "it that is the same name as the file with no extension (foo.cxx "
  65. "should have int foo();) DriverName will be able to call each of the "
  66. "tests by name on the command line. If EXTRA_INCLUDE is specified, "
  67. "then the next argument is included into the generated file. If "
  68. "FUNCTION is specified, then the next argument is taken as a function "
  69. "name that is passed a pointer to ac and av. This can be used to add "
  70. "extra command line processing to each test. The cmake variable "
  71. "CMAKE_TESTDRIVER_BEFORE_TESTMAIN can be set to have code that will be "
  72. "placed directly before calling the test main function. "
  73. "CMAKE_TESTDRIVER_AFTER_TESTMAIN can be set to have code that will be "
  74. "placed directly after the call to the test main function.";
  75. }
  76. cmTypeMacro(cmCreateTestSourceList, cmCommand);
  77. };
  78. #endif