1
0

cmCTestSubmitHandler.h 3.0 KB

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