cmCTestSubmitHandler.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. private:
  35. void SetLogFile(std::ostream* ost) { this->LogFile = ost; }
  36. /**
  37. * Submit file using various ways
  38. */
  39. bool SubmitUsingFTP(const std::string& localprefix,
  40. const std::set<std::string>& files,
  41. const std::string& remoteprefix,
  42. const std::string& url);
  43. bool SubmitUsingHTTP(const std::string& localprefix,
  44. const std::set<std::string>& files,
  45. const std::string& remoteprefix,
  46. const std::string& url);
  47. bool SubmitUsingSCP(const std::string& scp_command,
  48. const std::string& localprefix,
  49. const std::set<std::string>& files,
  50. const std::string& remoteprefix,
  51. const std::string& url);
  52. bool SubmitUsingCP( const std::string& localprefix,
  53. const std::set<std::string>& files,
  54. const std::string& remoteprefix,
  55. 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