cmCTestSubmitHandler.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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, const std::string& url);
  45. bool SubmitUsingHTTP(const std::string& localprefix,
  46. const std::set<std::string>& files,
  47. const std::string& remoteprefix,
  48. const std::string& url);
  49. bool SubmitUsingSCP(const std::string& scp_command,
  50. const std::string& localprefix,
  51. const std::set<std::string>& files,
  52. const std::string& remoteprefix, const std::string& url);
  53. bool SubmitUsingCP(const std::string& localprefix,
  54. const std::set<std::string>& files,
  55. const std::string& remoteprefix, const std::string& url);
  56. bool TriggerUsingHTTP(const std::set<std::string>& files,
  57. const std::string& remoteprefix,
  58. const std::string& url);
  59. bool SubmitUsingXMLRPC(const std::string& localprefix,
  60. const std::set<std::string>& files,
  61. const std::string& remoteprefix,
  62. const std::string& url);
  63. typedef std::vector<char> cmCTestSubmitHandlerVectorOfChar;
  64. void ParseResponse(cmCTestSubmitHandlerVectorOfChar chunk);
  65. std::string GetSubmitResultsPrefix();
  66. class ResponseParser;
  67. std::string HTTPProxy;
  68. int HTTPProxyType;
  69. std::string HTTPProxyAuth;
  70. std::string FTPProxy;
  71. int FTPProxyType;
  72. std::ostream* LogFile;
  73. bool SubmitPart[cmCTest::PartCount];
  74. bool CDash;
  75. bool HasWarnings;
  76. bool HasErrors;
  77. cmCTest::SetOfStrings Files;
  78. };
  79. #endif