cmCreateTestSourceList.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmCreateTestSourceList_h
  11. #define cmCreateTestSourceList_h
  12. #include "cmCommand.h"
  13. /** \class cmCreateTestSourceList
  14. * \brief
  15. *
  16. */
  17. class cmCreateTestSourceList : public cmCommand
  18. {
  19. public:
  20. /**
  21. * This is a virtual constructor for the command.
  22. */
  23. virtual cmCommand* Clone()
  24. {
  25. return new cmCreateTestSourceList;
  26. }
  27. /**
  28. * This is called when the command is first encountered in
  29. * the CMakeLists.txt file.
  30. */
  31. virtual bool InitialPass(std::vector<std::string> const& args,
  32. cmExecutionStatus &status);
  33. /**
  34. * The name of the command as specified in CMakeList.txt.
  35. */
  36. virtual const char* GetName() {return "create_test_sourcelist";}
  37. /**
  38. * Succinct documentation.
  39. */
  40. virtual const char* GetTerseDocumentation()
  41. {
  42. return "Create a test driver and source list for building test programs.";
  43. }
  44. /**
  45. * More documentation.
  46. */
  47. virtual const char* GetFullDocumentation()
  48. {
  49. return
  50. " create_test_sourcelist(sourceListName driverName\n"
  51. " test1 test2 test3\n"
  52. " EXTRA_INCLUDE include.h\n"
  53. " FUNCTION function)\n"
  54. "A test driver is a program that links together many small tests into "
  55. "a single executable. This is useful when building static executables "
  56. "with large libraries to shrink the total required size. "
  57. "The list of source files "
  58. "needed to build the test driver will be in sourceListName. "
  59. "DriverName is the name of the test driver program. The rest of "
  60. "the arguments consist of a list of test source files, can be "
  61. "semicolon separated. Each test source file should have a function in "
  62. "it that is the same name as the file with no extension (foo.cxx "
  63. "should have int foo(int, char*[]);) DriverName will be able to "
  64. "call each of the "
  65. "tests by name on the command line. If EXTRA_INCLUDE is specified, "
  66. "then the next argument is included into the generated file. If "
  67. "FUNCTION is specified, then the next argument is taken as a function "
  68. "name that is passed a pointer to ac and av. This can be used to add "
  69. "extra command line processing to each test. The cmake variable "
  70. "CMAKE_TESTDRIVER_BEFORE_TESTMAIN can be set to have code that will be "
  71. "placed directly before calling the test main function. "
  72. "CMAKE_TESTDRIVER_AFTER_TESTMAIN can be set to have code that will be "
  73. "placed directly after the call to the test main function.";
  74. }
  75. cmTypeMacro(cmCreateTestSourceList, cmCommand);
  76. };
  77. #endif