cmake/Source/CTest/cmCTestSubmitHandler.h

107 lines
3.1 KiB
C
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#ifndef cmCTestSubmitHandler_h
#define cmCTestSubmitHandler_h
2018-01-26 17:06:56 +01:00
#include "cmConfigure.h" // IWYU pragma: keep
2016-10-30 18:24:19 +01:00
#include "cmCTest.h"
#include "cmCTestGenericHandler.h"
2016-10-30 18:24:19 +01:00
#include <iosfwd>
#include <set>
#include <string>
#include <vector>
/** \class cmCTestSubmitHandler
* \brief Helper class for CTest
*
* Submit testing results
2012-02-18 12:40:36 +02:00
*
*/
class cmCTestSubmitHandler : public cmCTestGenericHandler
{
public:
2017-04-14 19:02:05 +02:00
typedef cmCTestGenericHandler Superclass;
cmCTestSubmitHandler();
2018-01-26 17:06:56 +01:00
~cmCTestSubmitHandler() override { this->LogFile = nullptr; }
/*
* The main entry point for this class
*/
2018-01-26 17:06:56 +01:00
int ProcessHandler() override;
2018-01-26 17:06:56 +01:00
void Initialize() override;
2009-10-04 10:30:41 +03:00
/** Specify a set of parts (by name) to submit. */
void SelectParts(std::set<cmCTest::Part> const& parts);
/** Specify a set of files to submit. */
void SelectFiles(cmCTest::SetOfStrings const& files);
2015-04-27 22:25:09 +02:00
// handle the cdash file upload protocol
int HandleCDashUploadFile(std::string const& file, std::string const& type);
2017-07-20 19:35:53 +02:00
void SetHttpHeaders(std::vector<std::string> const& v)
{
this->HttpHeaders = v;
}
2015-04-27 22:25:09 +02:00
void ConstructCDashURL(std::string& dropMethod, std::string& url);
private:
void SetLogFile(std::ostream* ost) { this->LogFile = ost; }
/**
* Submit file using various ways
*/
2015-04-27 22:25:09 +02:00
bool SubmitUsingFTP(const std::string& localprefix,
const std::set<std::string>& files,
2016-07-09 11:21:54 +02:00
const std::string& remoteprefix, const std::string& url);
2015-04-27 22:25:09 +02:00
bool SubmitUsingHTTP(const std::string& localprefix,
const std::set<std::string>& files,
const std::string& remoteprefix,
const std::string& url);
bool SubmitUsingSCP(const std::string& scp_command,
const std::string& localprefix,
const std::set<std::string>& files,
2016-07-09 11:21:54 +02:00
const std::string& remoteprefix, const std::string& url);
2015-04-27 22:25:09 +02:00
2016-07-09 11:21:54 +02:00
bool SubmitUsingCP(const std::string& localprefix,
const std::set<std::string>& files,
const std::string& remoteprefix, const std::string& url);
2015-04-27 22:25:09 +02:00
bool TriggerUsingHTTP(const std::set<std::string>& files,
const std::string& remoteprefix,
const std::string& url);
bool SubmitUsingXMLRPC(const std::string& localprefix,
2016-07-09 11:21:54 +02:00
const std::set<std::string>& files,
const std::string& remoteprefix,
const std::string& url);
2012-02-18 12:40:36 +02:00
typedef std::vector<char> cmCTestSubmitHandlerVectorOfChar;
void ParseResponse(cmCTestSubmitHandlerVectorOfChar chunk);
2010-03-17 14:00:29 +02:00
std::string GetSubmitResultsPrefix();
2016-07-09 11:21:54 +02:00
class ResponseParser;
2016-10-30 18:24:19 +01:00
2016-07-09 11:21:54 +02:00
std::string HTTPProxy;
int HTTPProxyType;
std::string HTTPProxyAuth;
std::string FTPProxy;
int FTPProxyType;
std::ostream* LogFile;
2009-10-04 10:30:41 +03:00
bool SubmitPart[cmCTest::PartCount];
bool CDash;
2010-03-17 14:00:29 +02:00
bool HasWarnings;
bool HasErrors;
2009-10-04 10:30:41 +03:00
cmCTest::SetOfStrings Files;
2017-07-20 19:35:53 +02:00
std::vector<std::string> HttpHeaders;
};
#endif