TZIVI-254: IVI needs a newer version of cmake
[profile/ivi/cmake.git] / Source / CTest / cmCTestSubmitHandler.h
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
4
5   Distributed under the OSI-approved BSD License (the "License");
6   see accompanying file Copyright.txt for details.
7
8   This software is distributed WITHOUT ANY WARRANTY; without even the
9   implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10   See the License for more information.
11 ============================================================================*/
12 #ifndef cmCTestSubmitHandler_h
13 #define cmCTestSubmitHandler_h
14
15 #include "cmCTestGenericHandler.h"
16
17 /** \class cmCTestSubmitHandler
18  * \brief Helper class for CTest
19  *
20  * Submit testing results
21  *
22  */
23 class cmCTestSubmitHandler : public cmCTestGenericHandler
24 {
25 public:
26   cmTypeMacro(cmCTestSubmitHandler, cmCTestGenericHandler);
27
28   cmCTestSubmitHandler();
29   ~cmCTestSubmitHandler() { this->LogFile = 0; }
30
31   /*
32    * The main entry point for this class
33    */
34   int ProcessHandler();
35
36   void Initialize();
37
38   /** Specify a set of parts (by name) to submit.  */
39   void SelectParts(std::set<cmCTest::Part> const& parts);
40
41   /** Specify a set of files to submit.  */
42   void SelectFiles(cmCTest::SetOfStrings const& files);
43
44 private:
45   void SetLogFile(std::ostream* ost) { this->LogFile = ost; }
46
47   /**
48    * Submit file using various ways
49    */
50   bool SubmitUsingFTP(const cmStdString& localprefix,
51                       const std::set<cmStdString>& files,
52                       const cmStdString& remoteprefix,
53                       const cmStdString& url);
54   bool SubmitUsingHTTP(const cmStdString& localprefix,
55                        const std::set<cmStdString>& files,
56                        const cmStdString& remoteprefix,
57                        const cmStdString& url);
58   bool SubmitUsingSCP(const cmStdString& scp_command,
59                       const cmStdString& localprefix,
60                       const std::set<cmStdString>& files,
61                       const cmStdString& remoteprefix,
62                       const cmStdString& url);
63
64   bool SubmitUsingCP( const cmStdString& localprefix,
65                       const std::set<cmStdString>& files,
66                       const cmStdString& remoteprefix,
67                       const cmStdString& url);
68
69   bool TriggerUsingHTTP(const std::set<cmStdString>& files,
70                         const cmStdString& remoteprefix,
71                         const cmStdString& url);
72
73   bool SubmitUsingXMLRPC(const cmStdString& localprefix,
74                        const std::set<cmStdString>& files,
75                        const cmStdString& remoteprefix,
76                        const cmStdString& url);
77
78   typedef std::vector<char> cmCTestSubmitHandlerVectorOfChar;
79
80   void ParseResponse(cmCTestSubmitHandlerVectorOfChar chunk);
81
82   std::string GetSubmitResultsPrefix();
83
84   class         ResponseParser;
85   cmStdString   HTTPProxy;
86   int           HTTPProxyType;
87   cmStdString   HTTPProxyAuth;
88   cmStdString   FTPProxy;
89   int           FTPProxyType;
90   std::ostream* LogFile;
91   bool SubmitPart[cmCTest::PartCount];
92   bool CDash;
93   bool HasWarnings;
94   bool HasErrors;
95   cmCTest::SetOfStrings Files;
96 };
97
98 #endif