cmake/Source/CTest/cmCTestSubmitHandler.h

80 lines
2.0 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. */
2021-09-14 00:13:48 +02:00
#pragma once
2018-01-26 17:06:56 +01:00
#include "cmConfigure.h" // IWYU pragma: keep
2016-10-30 18:24:19 +01:00
#include <iosfwd>
#include <set>
#include <string>
#include <vector>
2020-02-01 23:06:01 +01:00
#include "cmCTest.h"
#include "cmCTestGenericHandler.h"
/** \class cmCTestSubmitHandler
* \brief Helper class for CTest
*
* Submit testing results
2012-02-18 12:40:36 +02:00
*
*/
class cmCTestSubmitHandler : public cmCTestGenericHandler
{
public:
2020-02-01 23:06:01 +01:00
using Superclass = cmCTestGenericHandler;
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. */
2019-11-11 23:01:05 +01:00
void SelectFiles(std::set<std::string> const& files);
2009-10-04 10:30:41 +03:00
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;
}
private:
void SetLogFile(std::ostream* ost) { this->LogFile = ost; }
/**
* Submit file using various ways
*/
2015-04-27 22:25:09 +02:00
bool SubmitUsingHTTP(const std::string& localprefix,
2019-11-11 23:01:05 +01:00
const std::vector<std::string>& files,
2015-04-27 22:25:09 +02:00
const std::string& remoteprefix,
const std::string& url);
2020-02-01 23:06:01 +01:00
using cmCTestSubmitHandlerVectorOfChar = std::vector<char>;
2012-02-18 12:40:36 +02:00
void ParseResponse(cmCTestSubmitHandlerVectorOfChar chunk);
2010-03-17 14:00:29 +02:00
std::string GetSubmitResultsPrefix();
2022-03-29 21:10:50 +02:00
int GetSubmitInactivityTimeout();
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::ostream* LogFile;
2009-10-04 10:30:41 +03:00
bool SubmitPart[cmCTest::PartCount];
2010-03-17 14:00:29 +02:00
bool HasWarnings;
bool HasErrors;
2019-11-11 23:01:05 +01:00
std::set<std::string> Files;
2017-07-20 19:35:53 +02:00
std::vector<std::string> HttpHeaders;
};