cmCTestSubmitHandler.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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 cmCTestSubmitHandler_h
  11. #define cmCTestSubmitHandler_h
  12. #include "cmCTestGenericHandler.h"
  13. /** \class cmCTestSubmitHandler
  14. * \brief Helper class for CTest
  15. *
  16. * Submit testing results
  17. *
  18. */
  19. class cmCTestSubmitHandler : public cmCTestGenericHandler
  20. {
  21. public:
  22. cmTypeMacro(cmCTestSubmitHandler, cmCTestGenericHandler);
  23. cmCTestSubmitHandler();
  24. ~cmCTestSubmitHandler() { this->LogFile = 0; }
  25. /*
  26. * The main entry point for this class
  27. */
  28. int ProcessHandler();
  29. void Initialize();
  30. /** Specify a set of parts (by name) to submit. */
  31. void SelectParts(std::set<cmCTest::Part> const& parts);
  32. /** Specify a set of files to submit. */
  33. void SelectFiles(cmCTest::SetOfStrings const& files);
  34. // handle the cdash file upload protocol
  35. int HandleCDashUploadFile(std::string const& file, std::string const& type);
  36. void ConstructCDashURL(std::string& dropMethod, std::string& url);
  37. private:
  38. void SetLogFile(std::ostream* ost) { this->LogFile = ost; }
  39. /**
  40. * Submit file using various ways
  41. */
  42. bool SubmitUsingFTP(const std::string& localprefix,
  43. const std::set<std::string>& files,
  44. const std::string& remoteprefix,
  45. const std::string& url);
  46. bool SubmitUsingHTTP(const std::string& localprefix,
  47. const std::set<std::string>& files,
  48. const std::string& remoteprefix,
  49. const std::string& url);
  50. bool SubmitUsingSCP(const std::string& scp_command,
  51. const std::string& localprefix,
  52. const std::set<std::string>& files,
  53. const std::string& remoteprefix,
  54. const std::string& url);
  55. bool SubmitUsingCP( const std::string& localprefix,
  56. const std::set<std::string>& files,
  57. const std::string& remoteprefix,
  58. const std::string& url);
  59. bool TriggerUsingHTTP(const std::set<std::string>& files,
  60. const std::string& remoteprefix,
  61. const std::string& url);
  62. bool SubmitUsingXMLRPC(const std::string& localprefix,
  63. const std::set<std::string>& files,
  64. const std::string& remoteprefix,
  65. const std::string& url);
  66. typedef std::vector<char> cmCTestSubmitHandlerVectorOfChar;
  67. void ParseResponse(cmCTestSubmitHandlerVectorOfChar chunk);
  68. std::string GetSubmitResultsPrefix();
  69. class ResponseParser;
  70. std::string HTTPProxy;
  71. int HTTPProxyType;
  72. std::string HTTPProxyAuth;
  73. std::string FTPProxy;
  74. int FTPProxyType;
  75. std::ostream* LogFile;
  76. bool SubmitPart[cmCTest::PartCount];
  77. bool CDash;
  78. bool HasWarnings;
  79. bool HasErrors;
  80. cmCTest::SetOfStrings Files;
  81. };
  82. #endif