cmCTestSubmitCommand.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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 cmCTestSubmitCommand_h
  11. #define cmCTestSubmitCommand_h
  12. #include "cmCTestHandlerCommand.h"
  13. #include "cmCTest.h"
  14. /** \class cmCTestSubmit
  15. * \brief Run a ctest script
  16. *
  17. * cmCTestSubmitCommand defineds the command to submit the test results for
  18. * the project.
  19. */
  20. class cmCTestSubmitCommand : public cmCTestHandlerCommand
  21. {
  22. public:
  23. cmCTestSubmitCommand()
  24. {
  25. this->PartsMentioned = false;
  26. this->FilesMentioned = false;
  27. this->InternalTest = false;
  28. this->RetryCount = "";
  29. this->RetryDelay = "";
  30. }
  31. /**
  32. * This is a virtual constructor for the command.
  33. */
  34. virtual cmCommand* Clone()
  35. {
  36. cmCTestSubmitCommand* ni = new cmCTestSubmitCommand;
  37. ni->CTest = this->CTest;
  38. ni->CTestScriptHandler = this->CTestScriptHandler;
  39. return ni;
  40. }
  41. /**
  42. * The name of the command as specified in CMakeList.txt.
  43. */
  44. virtual const char* GetName() const { return "ctest_submit";}
  45. /**
  46. * Succinct documentation.
  47. */
  48. virtual const char* GetTerseDocumentation() const
  49. {
  50. return "Submit results to a dashboard server.";
  51. }
  52. /**
  53. * More documentation.
  54. */
  55. virtual const char* GetFullDocumentation() const
  56. {
  57. return
  58. " ctest_submit([PARTS ...] [FILES ...] [RETRY_COUNT count] "
  59. " [RETRY_DELAY delay][RETURN_VALUE res])\n"
  60. "By default all available parts are submitted if no PARTS or FILES "
  61. "are specified. "
  62. "The PARTS option lists a subset of parts to be submitted. "
  63. "Valid part names are:\n"
  64. " Start = nothing\n"
  65. " Update = ctest_update results, in Update.xml\n"
  66. " Configure = ctest_configure results, in Configure.xml\n"
  67. " Build = ctest_build results, in Build.xml\n"
  68. " Test = ctest_test results, in Test.xml\n"
  69. " Coverage = ctest_coverage results, in Coverage.xml\n"
  70. " MemCheck = ctest_memcheck results, in DynamicAnalysis.xml\n"
  71. " Notes = Files listed by CTEST_NOTES_FILES, in Notes.xml\n"
  72. " ExtraFiles = Files listed by CTEST_EXTRA_SUBMIT_FILES\n"
  73. " Submit = nothing\n"
  74. "The FILES option explicitly lists specific files to be submitted. "
  75. "Each individual file must exist at the time of the call.\n"
  76. "The RETRY_DELAY option specifies how long in seconds to wait after "
  77. "a timed-out submission before attempting to re-submit.\n"
  78. "The RETRY_COUNT option specifies how many times to retry a timed-out "
  79. "submission.\n";
  80. }
  81. cmTypeMacro(cmCTestSubmitCommand, cmCTestHandlerCommand);
  82. protected:
  83. cmCTestGenericHandler* InitializeHandler();
  84. virtual bool CheckArgumentKeyword(std::string const& arg);
  85. virtual bool CheckArgumentValue(std::string const& arg);
  86. enum
  87. {
  88. ArgumentDoingParts = Superclass::ArgumentDoingLast1,
  89. ArgumentDoingFiles,
  90. ArgumentDoingRetryDelay,
  91. ArgumentDoingRetryCount,
  92. ArgumentDoingLast2
  93. };
  94. bool PartsMentioned;
  95. std::set<cmCTest::Part> Parts;
  96. bool FilesMentioned;
  97. bool InternalTest;
  98. cmCTest::SetOfStrings Files;
  99. std::string RetryCount;
  100. std::string RetryDelay;
  101. };
  102. #endif